Questions tagged [javascript]

Javascript is a dynamic computer programming language, most commonly used as part of web browsers, whose implementations allow client-side scripts to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed.

1
vote
2answers
41 views

How to get all properties of a Site Page using REST API?

I am writing an application in AngularJS for a SharePoint 2013 site collection, using the REST API to talk to SharePoint. My task is to update the Image Link in the Title Bar Properties of every Web ...
1
vote
1answer
740 views

IIS 401 errors getting custom master page css and js

Environment: 2013 Enterprise, single WFE, full control of environment I'm building a custom master page for a SP site collection using a very basic setup. It's a simple responsive HTML page using ...
1
vote
1answer
26 views

Change Width of text box in edit form

To improvement design of my app on sharepoint SP2013, I need change (in my case reduce) the width of text box of new form, how do it!? some idea?
2
votes
2answers
761 views

jquery.done runs before when - deferred promise

I have placed a SEWP in an editform and the code is supposed to do the following: check if the logged in user is site administrator and web administrator - if not then hide a specific field. These two ...
2
votes
1answer
878 views

jslink hide or disable options in choice field on quick edit view for SharePoint lists

I want to disable or hide options in a choice field on a sharepoint list because some of the value should not be selected after a specific date but must be in the list for older items. Is there a ...
1
vote
2answers
803 views

How do I hide list columns in a view

I have 3 list webparts on my home page. I've used this script to hide 2 columns on page load and changes (sorting, filtering). // Override list views to hide language columns based on locale ...
0
votes
0answers
10 views

StratusForms Datepicker in Repeating Row

I'm using Mark Rackley's StratusForms 1.5. In his docs and other posts, he states that datepickers work in repeating rows. You can now execute code when repeating rows are added or removed, and ...
2
votes
2answers
610 views

JQuery add class to url when on page in current navigation menu

I'm currently using the SharePoint Web Control spnavigationmanager to create a navigation for sites that are easily configurable by going to Site Settings > Navigation and making changes there. I'm ...
0
votes
1answer
16 views

Use REST API to get group SharePoint 2010

I have a group on my site - I want users to be able to add and remove themselves from this group via a button on a page. What is the URL I should be using as a parameter to retrieve the group and the ...
0
votes
0answers
14 views

Can I leverage the OOB Assigned To Email Notification functionality to send an email to the Created By user?

I have an Issues List with customization in SharePoint that I've chose to enable email notifications to the Assigned To person after the issue is assigned. I'd like to also send an email notification ...
0
votes
1answer
20 views

Start Workflow via JS gives error “Value cannot be null”

Hi I am attempting to start an SP 2010 workflow using Jquery SP Services but i seem to be getting a response 500 Value cannot be null. There is not supposed to be an initiation form yet when i ...
3
votes
1answer
796 views

SharePoint 2013 App Office 365 copy list item

I try to build an SharePoint hosted app, have started with a custom menu action. When I choose it I want to copy the selected item and automatically change some metadata for it. Problem is I can't ...
0
votes
3answers
33 views

Add list items to Object & Properties - javaScript

I'm trying to copy specific field data from list items to properties in an object, which appears to be working, however, I have multiple rows of data and the function is pasting the same row every ...
1
vote
1answer
948 views

ModalDialog // change title when dialog openned

I open popup modal dialog with something like this: openInDialog: function (dlgWidth, dlgHeight, dlgAllowMaximize, dlgShowClose, needCallbackFunction, pageUrl) { var options = { autoSize: ...
5
votes
1answer
599 views

Print Gantt View

We need develop a custom webpart to print the Gantt view of a tasks list. Has someone developed some similar? We are trying to do it with the jsgrid library in JavaScript, using the ...
2
votes
1answer
592 views

Approve Permission to list item in SharePoint 2013

I have to set approve permission using JavaScript client object model. I have used below code to set other permission. But for Approve it is not working. function breakSecurityInheritance(lastItemId)...
1
vote
2answers
20 views

Get the data from Multi line Text field and set it to text area line by line

I have a multi line rich text field and I want to get the data from column and set in text area line by line. I tried Splitting but I need another solution if possible.
0
votes
1answer
598 views

How to save CSV data to SharePoint 2013 list without iterating through the each record using JavaScript/REST?

I am having CSV with more than 3500 records. My need is to import the CSV data to SharePoint 2013 custom list. I have to achieve this programmatically. I have already tried some bulk operations/...
2
votes
1answer
797 views

ECMA script for checking active workflows for an list item

Hi i am having more than 1 workflow associated with the list if there is any workflow that is active for an item then i need to prevent starting another workflow for the same item. I am using the ...
1
vote
1answer
884 views

how to display a contacts list in accordion view?

I want to display a contacts list in SharePoint 2013 as accordion. I tried to use the code from https://code.msdn.microsoft.com/office/Client-side-rendering-code-ccdb2a0e/view/Discussions/0?...
2
votes
1answer
868 views

Remove list item permissions by role type using JSOM

I'm looking for a good way to remove all list item permissions on a certain list item of a specific role type using the JavaScript object model. With myListItem.get_roleAssignments().getByPrincipal(...
0
votes
1answer
17 views

Sharepoint 2013: Moving a field o be side by side with another field doesn't save it

in an list/EditForm.aspx, I have the following code to copy/paste a field to another place: var dest = $('span[title="MyTitle"]').parents("tr:first"); // place to be copied var source = $("input[id*='...
5
votes
4answers
10k views

JS files returning Cached (Old) Versions Despite Update

We are currently in the wild throes of a migration from SP 2007 to SP 2010. I'm attempting to move some custom JavaScript Validation from the current production site to our staging site. My ...
0
votes
1answer
41 views

Javascript code inside my aspx page layout were smarter than i thought, and worked well on different regional settings and date format out of the box

I am working on an enterprise wiki site collection inside SP on-premises 2013. and inside the page layout i added this javascript, which get 2 date fields values from the current page (expirydate &...
0
votes
0answers
27 views

Document Open In IE

I have a pdf documents stored in SharePoint document library. By default the document open in Edge as the browswer is fine for some of the other documents in the library but the others I want to open ...
0
votes
1answer
16 views

REST API or CSOM JS GetList return URL

I need to get url list, Title is ready, Title is not equals url. var clientContext = SP.ClientContext.get_current(); var website = clientContext.get_web(); var list = website.get_lists().getByTitle("...
2
votes
3answers
936 views

pass parameter to 2nd function jsom

Hi I have the following code, how can I pass oList into function onQuerySucceeded? function lockMandaysItems(tID,oList) { var clientContext = new SP.ClientContext.get_current(); var oList = ...
0
votes
1answer
849 views

How to change default view of library using javascript or programatically?

I have a requirement where I have to change view based on users logged into the portal. If user belongs to guest view then view should be different and if he is logged in as admin a different view ...
0
votes
1answer
16 views

Get Workflow Status Programmatically in SharePoint Using Client Side Object Model JavaScript

I am trying to monitor the status of workflows using JavaScript in the SharePoint Farm. List A: Number of Completed: In Progress: Error occurred: List B: ...
0
votes
1answer
33 views

Javacript as Webpart to change Content Types

I am not allowed to change the Content Type of a file using the Quick Edit. I was wondering if there is any JavaScript code that I can add as a Web Part to the document Library. This code should ...
0
votes
1answer
24 views

How to set SharePoint list column font color using JavaScript

My question can be answered via two different ways: 1) How can I set the font on columns = white (to fake them being hidden)? I currently tried to use FieldName.fontcolor("white") and FieldName....
0
votes
0answers
15 views

Add validation to a Date field inside our publishing site's page layout using JavaScript/jQuery

I am working on an enterprise wiki site collection inside sharepoint farm 2013. I have a Date field named "ExpireDate" and i added it inside the EnterpriseWiki.aspx page layout. Here is the markup for ...
1
vote
4answers
1k views

Hide empty columns in view

its possible to hide empty column(s) from view(webpart) in Sharepoint 2013? I was looking for any javasript solution, but unfortunately i have found only solution for boxed style. Hide columns from ...
0
votes
1answer
20 views

Creating Custom WebPart — RangeErrror / TypError trying to access data from a file

Hi I'm new to using SharePoint and I'm trying to transfer over an Employee Directory Search app from a website to SharePoint Foundation 2013. I'm not able to use the same code in my .JS file and am ...
0
votes
1answer
866 views

Javascript and add user to Active Directory group in Sharepoint

How to add user to active directory group? How can I add user to the Active Directory by the javascript code. I have got a script which adding to Sharepoint Group, but how Could I do it with Active ...
1
vote
1answer
900 views

Issues with SPFilterDropdown in SPD2013

To start things, I have little knowledge beyond the basic concepts of SPD and being a newbie... What I want to accomplish is to only have certain values from another list show up in which their ...
0
votes
2answers
923 views

how to retrieve all surveys in my site using javascript/csom

I have created some surveys using survey app,I want to list all surveys existing on my site using client object model.
0
votes
1answer
870 views

Reset sharepoint lookup with None option using jquery

How to reset the lookup value to None in Editform.aspx page using Jquery. I want to empty the lookup dropdown if text box does not have any value . Here is the code which i have tried.I was able to ...
3
votes
1answer
922 views

ctx.CurrentItem undefined in new function

I am editing a item display template in SharePoint 2013. The following problem occurs: ctx.CurrentItem becomes undefined in a custom function. How can I solve this? Here is a little code snippet: ...
0
votes
1answer
875 views

Image Overlay with Text using javascript in Sharepoint referencing to a “List Library” (adjust frame size)

Below is my code for displaying images with text overlay (referencing from one of my list). <style type="text/css"> .myFrame1 { position: relative; overflow: auto; } .myFrame1 li { list-...
0
votes
0answers
11 views

Picture Library Slideshow Web Part Image Resize

So I have a folder with some images with the same dimensions and I am trying to have a slideshow in the homepage with these images. Everything is working fine except that there is a significant white ...
0
votes
1answer
549 views

How i can change the Label for my Discussion Board App from “new discussion” to something else

I am working on SharePoint online 2013. and i add a new Discussion Board App inside my Team site collection. now i name the new app as "News & Announcement", so i was expecting that the defualt ...
0
votes
2answers
655 views

jQuery.addClass working in Chrome but not IE11

I'm working with a "new item" form for a SharePoint survey. In Chrome, the following code shows an alertbox and then makes every other row darker. In IE 11, the following code shows an alertbox but ...
0
votes
2answers
39 views

How to SP2013 list put it into DataTable dynamically?

I have a sharepoint 2013 list with some items, I need to put it into DataTable dynamically, is possible create the html table automatically?
1
vote
2answers
3k views

Delete all items in Recycle Bin using javascript

Is there a way to batch delete all items in the recycle bin on the client side in SharePoint Online? I've tried using javascript:emptyItems() in the browser but this appears to time out after ...
0
votes
1answer
26 views

Get item from external list field with ajax - SP2013

I have a list and some columns retrieve value from external list. How to get all items from that list(attached img) with REST I'm trying like this function traerSolicitudes() { var lista = "...
0
votes
2answers
100 views

Get Page Field Values with javascript

We are using SP 2013 publishing features and have the document id service turned on for our site collection. So each new page has a document id assigned to it. We also created a custom content type ...
1
vote
1answer
870 views

current user is always is administrator on a SharePoint App

I have tried following solution to check the current user's permissions on the current host web in a SharePoint hosted app, however the user is always administrator. function sharePointReady() { ...
3
votes
2answers
845 views

Get object of ribbon button in JavaScript

I am trying to access the ribbon button via JavaScript. Below is my code: // Get the page manager var ribbonPageMgr = SP.Ribbon.PageManager.get_instance(); // Get the ribbon var ribbon = ...
0
votes
0answers
13 views

Include external script in display template

I'm creating a custom search result display template. I'd like to reference an EXTERNAL javasacript. The only examples I've seen copy the JS file into a library on the server and reference it from ...