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.

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

changing list and library view with javascript

I have two lists, each with 5 views, and a dataview webpart displaying data from a third list. I want the two lists to automatically change there view based on the contents of the Phase field in the ...
1
vote
0answers
13 views

How to selectively hide links in a promoted links webpart using JS

I have a promoted links webpart with three tiles where the links direct to various approval stages and I don't want the m all to show at once. I want to hide 2 of the tiles by default and reveal them ...
1
vote
2answers
18 views

Field Value of Loaded List Item is Unexpectedly Returning “NaN”

I'm trying to query the last item in the current list where status = New, so I can auto-populate one of the fields based on the previous item's value. Executing "alert(collListItem);" displays "[...
0
votes
0answers
17 views

ajax web service call and how to handle the response

I have SharePoint 2016 Documentset and iam using webservice endpoint from SharePoint to download it as zip and wanted to upload into another document library in different site Collection. <script ...
1
vote
2answers
27 views

CAML Query Last List Item Where Status = New

I have a SharePoint 2013 custom list and a requirement to load the last list item where Status = New. I first tried SPGetLastItemID with a CAML query filter - however, that method only returns items ...
1
vote
0answers
9 views

Update the index of the related object after spice in an object using JavaScript [on hold]

There are 2 variables: var brands = [ {Brand: "Hyundai"}, {Brand: "Toyota"}, {Brand: "Honda"}, {Brand: "Volkswagen"} ] var cars =[ {Car: "Elantra", BrandIndex = 0}, {Car: "...
0
votes
0answers
4 views

Large document comparison in JS

I am creating code that will compare two large documents to identify the changes. Are there any JavaScript libraries that will accomplish this or help me to do this? Any guidance will be appreciated.
1
vote
1answer
681 views

Manipulate Filters in Javascript

Is there any code in JavaScript which allow to manipulate filter to a library webpart?
0
votes
1answer
9 views

Why is this expand/collapse all button not working in webpart? [on hold]

I added a content editor webpart and added some code to it by linking it to an HTML file. I copied the code from https://codepen.io/heydon/pen/ZXgqKG It is a collapsible section web component with ...
0
votes
0answers
6 views

create an array for unanswered survey question items

I have a SharePoint survey and I need to create an array of survey questions that have been left unanswered using JS. Then I need to create an unanswered array index tracker where the ...
0
votes
0answers
8 views

Get Office 365 group members from REST API

I'm developing a solution to send SharePoint documents (links) to domain users sending an e-mail. This solution is based on a classic list form, where an user select a document and can choose user ...
1
vote
1answer
752 views

Custom Ribbon Button with javascript

Hi i'm working on a sharepoint Addin i wanna create a custom ribbon button using javascript , i tryed with xml it's work fine using this code : <?xml version="1.0" encoding="utf-8"?> <...
1
vote
1answer
23 views

Disable Filter on Individual Column Headers of Custom List

I'm working with SharePoint 2013 and my Company don't allow the use of SharePoint Designer. I have created a custom list and am looking to disable the column header filter from a number of the ...
1
vote
2answers
878 views

How do I hide the FINISH and CANCEL buttons on SharePoint survey?

I am working with SP online. And i have written a custom code "JavaScript". I am primarily looking to hide those Two button's from my SharePoint survey list as mentioned above in the title. Below is ...
0
votes
1answer
643 views
0
votes
0answers
28 views

Plain Text validation on presave function sharepoint

I have OOTB list. On new item adding I want to validate, on drop-down selection if value is USA three multi-line text box will show with mandatory field. I know we have to write validation on PreSave ...
1
vote
3answers
36 views

Script Editor web part not allowing me to insert code (or cancel)

Whenever I paste the following code into the script editor, instead of it allowing me to click 'insert', the entire window changes into the output of my script. There is no way to circumnavigate this ...
0
votes
1answer
29 views

PnP js call returns “Item does not exist”

I'm running a small code to upload file in a SharePoint 2016 document library and to change a metadata. Sometimes (but really often) my code returns error "Error making HttpClient request in ...
0
votes
1answer
16 views

Add jquery reference to JSlink file

I am using JSLink feature of SharePoint 2013, My JSLink file has code to get current user id and other details, for this I need to add reference of jQuery file. I tried adding those files in in ...
1
vote
1answer
80 views

Register Custom Action with Javascript

I am having difficulty registering a custom user action through JavaScript. I am using the following code example. The code executes without any error however the button fails to appear on the Ribbon. ...
2
votes
1answer
720 views

Redirect to thank you page after submitting survey

I'm using sharepoint 2013.I created a survey using the survey app. I added a web part script to the survey. I tried to redirect to a thank you page after clicking the finish button on my survey. It ...
0
votes
3answers
43 views

SharePoint online add link to a document library on new list item

starting to use SharePoint online and I am loving it so far. However I need some guidance (if anyone can guide me by giving me material where to look at). Basically I want to modify the ItemAdded ...
1
vote
1answer
722 views

getItemByID is not a function

I have the following script that is returning the error message "list.getItemByID is not a function" and I can't figure out why. All examples use this function. I am trying to iterate through ...
0
votes
2answers
718 views

Disable Edit WebPart and/or Snippet link in a Script Editor Web Part on SharePoint Page?

I know it can be done with client side coding, but maybe there is a built in way to do this in SharePoint 2013. I have a web part I share with other sites, but do not want site administrators seeing ...
0
votes
1answer
735 views

Save Modal Dialog Field Value to Refresh Page DIV

I found a couple great functions that allow me to programmatically call up a modal edit form, and they work very well. What I'm looking for is a way to update a div on the calling page with the ...
1
vote
1answer
33 views

Color Coding List Item by Web Part based on value

I am currently trying to get color coding on a list to highlight good medium and bad properties. I have tried to follow the examples shown here for color coding: SharePoint 2013 Client Side Rendering:...
0
votes
1answer
733 views

REST addViewField “Cannot handle the data at position 0.”

I'm currently writing an initialisation script for a SharePoint-hosted application which checks if a list (used for launcher items) exists. If it doesn't, then it runs through a series of processes to ...
3
votes
4answers
5k views

Adding notification from server side, code ignoring ExecuteOrDelayUntilScriptLoaded

I'm trying to add a UI notification from server side. To do this, I've written this code in one of my code behind event handler: private void AddNotifySuccessScript() { var ...
0
votes
1answer
10 views

Javascript issue in Chrome with AddAnApp.aspx

I have created a piece of code which will check if your on addanapp.aspx page and if so it will read your permissions on a list and if you have EditList perms it shows 'Custom List' app only on add an ...
0
votes
1answer
41 views

expandable list of columns ( sharepoint 2013)

I have a list with too many columns (over 20 columns) and I would like to make some of these columns expandable to make the navigation easy for users. is it possible, knowing that I don't have ...
0
votes
0answers
13 views

Open built-in “Manage Access” dialog from javascript

SharePoint Online has a few nice dialogs such as "Manage Access" for a specific document. If you select "Share" for document you get this dialog: You can select "Manage Access" and get this nice ...
0
votes
1answer
741 views

Populate a Word Template with Dynamic Data From a HTML Form on a Sharepoint Page

I have a SharePoint site. What I want to do is: 1) Upload a Proposal Template and create an HTML form that allows our sales guys to enter customer details 2) Allow the sales guy to select some options ...
0
votes
1answer
38 views

JavaScript in SharePoint Online

I was wondering how i would go about implementing JS into my SharePoint online master page. Is the best way to have a separate file with JS functions that is stored in the site contents and then ...
1
vote
4answers
3k views

Get last modified date of item added/updated in a site - JavaScript

I want to get the date / time stamp for the last item was added / updated to SharePoint site using JavaScript. Is there any API in JS to do so? Thanks.
4
votes
2answers
3k views

What are the advantages of using SP Services?

What advantages would I gain by using the SP Services library in SharePoint releases 2010 and later? The 2013 (and even the 2010) JavaScript Object Model and REST API seem to cover a significant ...
0
votes
2answers
680 views

SharePoint cascading drop down on visual web part using client side code

Hi I am working with cascading drop down in a visual web part. I am able to complete this functionality using c# but I want to implement this functionality using JavaScript jquery basically I want to ...
0
votes
1answer
716 views

Export out data view list to Excel

I have a data view list made using a linked data source of several SP lists. I tried to make it so that the data view list can be exported out as Excel, just like SP list. Is this possible? I tried ...
4
votes
1answer
777 views

401 (Unauthorized) in Google Chrome

When I Get the document list from SharePoint site I get this error "401 (Unauthorized)" only in Google Chrome, but in IE it works. This is my code function GetListItems() { var siteURL = "http://...
1
vote
1answer
787 views

Files move from one library to another library using jsom

Below code is working fine, but inside for-loop if I put alert,then moving multiple file but if I remove, only one file moving. I do not want any alert/pop up. Please suggest. ...
0
votes
0answers
19 views

How to ensure field is unique using JavaScript

I have two lists: List A - a workflow tasks list List B - an employees list containing fields such as employee name (person column), employee number (single line of text), etc. I have a workflow ...
4
votes
1answer
728 views

SharePoint Workflow Subscription Service failed

I have one requirement to start the SP workflow through JavaScript. For this, I have wrote some lines of code to start the workflow. But I am getting a Subscription failed error due to undefined ...
6
votes
6answers
26k views

How to set the people picker field using jquery in sharepoint 2013 to current user

I was able to set the current user to people picker field in SharePoint 2010,but now i am new to SharePoint 2013 . Please tell me how to set the current user value to that filed. In SharePoint 2010- ...
3
votes
1answer
801 views

Filter sharepoint list using multi line text field

I'm trying to filter a sharepoint list using ajax api. So one of the filtered field is Multi line text field (FieldType.Note) , after performing request it throws an error telleing that the field ...
3
votes
2answers
751 views

To ScriptLink or not to ScriptLink

I need a custom ribbon button that calls a function in a js file in one particular library. To get access to the JS file, I could: Add the JS file reference via a content editor web part on the ...
0
votes
1answer
24 views

How to open up View Item from task list in SPO in a new tab

I am working with SPOnline Task list. Users click on View Item for a given task to go to the display form which by default opens in same window. Is there a way to open it up in a separate tab? ...
0
votes
1answer
867 views

How to get Sharepoint 2013 variation URL?

I want to create a toggle button for variations, so that when I am on the en or fr page, and I click the button it takes me to the other page. But I can't just change the en to fr, for example, ...
0
votes
1answer
739 views

Get document from Document Library using Javascript

I am trying to get a document from document library.I am getting the file but I can't get its binary value. $.ajax({ url: fileUrl, binaryStringResponseBody: true, headers: { "...
0
votes
1answer
811 views

Allow a SharePoint document to be displayed in a frame

I have a SharePoint list with attachment, I want to display these attachment in a Frame for preview but I get this error: This content cannot be displayed in a frame To help protect the security of ...
1
vote
1answer
816 views

use SP.UI.Dialog on page load without ExecuteOrDelayUntilScriptLoaded

I know I can do this: ExecuteOrDelayUntilScriptLoaded(function() { SP.UI.ModalDialog.showModalDialog(..) }, "sp.js"); But I want to call SP.UI.ModalDialog.showModalDialog as soon as the page ...
0
votes
2answers
28 views

How to chain promises for multiple ajax calls to SharePoint to get user ids?

Broken promises, thought I had it figured out, still trying to get reliable results. Console log shows hit and miss results. Below is the rundown of what I'm trying to achieve. Is there a simpler way ...