Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
24 views

Sharepoint Rest API Error 403

i have a sharepoint farm with two different web applications. When i'm trying to access the second web application with java script from a page of the first web application, i always get an http error ...
0
votes
4answers
52 views

How To: Query & Display items from ALL lists within a subsite

I am looking to query and display items from all of the lists that exist (and will exist in the future) on a specific subsite (SP 2013). Below is what I have so far but it is not producing any alert,...
1
vote
2answers
26 views

JS Code not working on SharePoint 2013 list but works on office 365/SPO list

I am using below JS code to hide/remove duplicate values from a lookup column. <script language="javascript" type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></...
1
vote
0answers
27 views

UI not loading properly after adding SharePoint script files

I have added following script files for like functionality in SharePoint .aspx page in SPD. <SharePoint:ScriptLink Name="MicrosoftAjax.js" runat="server" Defer="False" Localizable="false"/> <...
1
vote
1answer
48 views

Add files to subfolders using rest api in javascript

What is working right now is i can upload to the root folder of a library using the code below : myDropzone.options.url = `${_context.pageContext.web.absoluteUrl}/_api/web/Lists/getById('${_parent....
0
votes
3answers
49 views

See if UserId exists in column

What can I do to see if the current User ID already exists in the column ("QuemLeuId") of type "Person Group" for particular Item in the list? Can someone help me? Thank you. window.onload = ...
0
votes
3answers
33 views

SyntaxError: unexpected token: '+='

I'm looping through records and setting a variable according to an if statement. I'm trying to build the output variable with the results of all the looped records into one string using +=. I'm ...
0
votes
3answers
66 views

ADD Multiple UserID's into a column

I want to add multiple UsersID's into a column. Column type is "People and Group". Everytime it's inserted an userid, he smashes the other one, staying only one. Can someone help me? Thank You. //...
2
votes
1answer
17 views

How to get item ID from a dropdown lookup jQuery?

I need to grab ID from the value user selects from a dropdown box. I had this code from years back and it worked before but now it returns everything. (see print shot of the alert). All I needed is ...
1
vote
0answers
35 views

Fill Dropdown From List Using JSOM /ECMA Script

I am trying to retrieve items in from a share point list, to populate a drop down box in a SharePoint application using java script. //Retrieve List var ItemContainer = { ItemList: [] }; ...
2
votes
1answer
29 views

How to restore a Default Display Form (DispForm.aspx)

In my Default Display form I had previous added a webpart which included javascript code to suppress some of the form fields - all good so far. Today, I wanted to add a webpart to display a list view,...
2
votes
1answer
205 views

SPFx calls blocked by CORS policy

I'v been trying to access various apis through SPFx and I am constantly seeing this issue. I do not know how to fix this can anyone assist or explain what I am doing wrong or missing? This works ...
0
votes
1answer
40 views

SharePoint app not writing to list (Javascript)

I am trying to create an app which posts information to a SharePoint List. function createListItem() { try { var userName = document.getElementById("name").value; var ...
0
votes
0answers
183 views

Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request

I'm trying to make a call to Slack by building the request inside SPFx webpart. I get this error: Access to fetch at 'https://slack.com/api/users.list/?token=xoxp-...
4
votes
2answers
245 views

Create modern team site in SPFx

I found some articles which are explaining creating modern sites with CSOM. But I am not able to find in JavaScript to use in SPFx. Creating modern sites is supported with SPFx? Any PnP extension ...
2
votes
0answers
20 views

Update a library field when uploading a file using javascript

I am using a spfx webpart to upload a file and modified a column value associated tothat file. The code below works and stop working without any reason and i can modify only the title field with it. I ...
1
vote
0answers
23 views

Request Failed. Specified Argument was out of Range, Parameter Name: Index undefined

I have this custom action in sharepoint where the page will be redirected to another url but the components of the URL are dependent on a fielvalue in its parent folder, Request Failed. Specified ...
0
votes
1answer
25 views

Cannot locate a notification email

I think I have found another odd thing using SharePoint 2013. I have a custom list that sends notification emails. There are 5 working SharePoint Designer workflows connected to it that are sent at ...
1
vote
1answer
76 views

How to get ClientContext in Sharepoint Online with JSOM

var context = SP.ClientContext.get_current(); throws this error, Uncaught ReferenceError: SP is not defined the snippet works fine in SharePoint 2013, Are there .js that I need to load? if yes, ...
1
vote
1answer
45 views

How to get item ids when using JSOM (when not it in content.executeQueryAsync)

is it possible to get item ids when not using executeQueryAsync. See my code below. I would like to get the item ids as i'm doing below in successGetListItemId() but would like to store in an array ...
1
vote
1answer
21 views

Using JavaScript and DOM manipulation to create Cascading Drop Down but rendering incorrectly

I have a simple list that has two drop downs. I am using JavaScript to create a cascading drop down functionality. A reference to my JavaScript file is placed in a content editor webpart of the list ...
2
votes
1answer
28 views

Calling executeQueryAsync in each loop for sharepoint javascript

I want to update table rows with information from a Sharepoint list. So, I am calling executeQueryAsync within a For Loop and it only updates the last item, but not all. var oRows= $('#dataTable tr');...
1
vote
0answers
14 views

XML error when searching an item in SharePoint list

I am using a custom JS (which is borrowed) to show repeated section as in a more readable format, which does work fine. However, when using the search field then it throws an XML Invalid error... ...
1
vote
0answers
35 views

How to remove list from site when spfx web part removed?

Modern SPFx web part creates a new list 'abc' using code when it is added to site contents. Now I want to remove list 'abc' automatically when web part is removed from site contents(using code not ...
1
vote
1answer
52 views

AJAX REST call to POST to SharePoint list generates error

I am having difficulties with the JQuery implementation of AJAX to make REST calls to POST data to add items to my SharePoint list. Using 'GET' to retrieve information gives me no issues. Given the ...
1
vote
0answers
18 views

Dom changes using javascript Cancels out Css [closed]

I am brand new to programming and javascript, and recently I tried practicing javascript with a website I created and whenever I declare any change in the DOM the website loses its css. Example: ...
1
vote
1answer
33 views

to get all the values of the managed metadata column

I have a managed meta data column in my list "Employee" named "Office Location". the metadata column refers to a TermStore "headquarter". How do i get all the values of the termstore in javascript to ...
2
votes
0answers
18 views

permissionKind returns void in React

I have a search function that returns all list items including their parent link based on their content type, tenant-wide. Every list item comes from a specific subsite and I want to split the ...
1
vote
1answer
24 views

Jquery code doesn't work after SharePoint ListView paging

I wrote a custom onclick event for a class in jquery, I have attached the script with JS link of listview web part. There is default paging in the listview web part. In first page the click event ...
0
votes
0answers
26 views

DocumentID Links sending users to search page

I built an app that returns files in a document library. and provides links to those files using documentIDs. We migrated the site from 2013 to 2016 and now the links instead of opening the files, ...
1
vote
2answers
80 views

Using Javascript REST API to do asynchronous batch POST to multiple SharePoint lists

I'm in a bit of a quandry as I'm just learning how to do development in SharePoint 2016 / SharePoint Online and using Javascript to perform REST calls. I have a form that is using REST to successfully ...
0
votes
1answer
87 views

Change a specific column of a specific item

I have a column WhoRead(type: "Person or Group") and an onclick event. When I click on an item I want to fill the column "WhoRead" with the current user email. I already have the code to get the ...
1
vote
1answer
35 views

Sharepoint 2013 Retrieving values from list and autopopulate input fields using javascript

I have this list And I have this form Which has to be autopopulated when the user input the Employee ID from the list. Thanks
0
votes
1answer
24 views

Adding body to mailto:XXXX@email.com?Subject=Test in SharePoint list view

I am trying to add body to an email that i sending through JavaScript. I have a SharePoint list view when clicked on sends an email to EmailID. This works fine, var mail=&quot;mailto:&quot;+...
0
votes
1answer
41 views

Print all list items of particular user in SP list?

It's my first time here and very new in SP. I have created a list for overtime of staffs. one overtime per list item. At the end of the month, the requirement is to print all overtime made by a ...
1
vote
2answers
50 views

Make a Chart with multiple Sharepoint lists (using AngularJS)

few days ago I posted a question on how to do a Chart with AngularJS of a sharepoint list, here's the link. Now I have a more complicated one: how to make a chart with multiple lists? I'm using ...
0
votes
1answer
31 views

Dynamic calling function to read data from SP List

I'm trying to do something similar to this, but with a dynamic calling function name so that I can reuse the function. I followed Danny's suggestion, but I am getting the error: Uncaught TypeError:...
0
votes
1answer
35 views

can't find sp.runtime.js

Trying to use a people picker in a sharepoint online MVC add in but when I try to import the javascript files needed I get "not found" error in the Error List. This is how I try to import the files &...
0
votes
2answers
71 views

sharepoint get list item returning wrong date time

i noticed while testing that the sharepoint get list item call i am making through pnp sp is wrong. i tried going to the endpoint url directly to check but the return date is the same (wrong date) . ...
1
vote
2answers
55 views

CAML Query for retrieving only document library items in only one folder

I'm trying to access the documents in a specific folder in a SharePoint document library. the library has multiple folders but I do know the name of the folder. here is an example of the file tree (I ...
0
votes
0answers
27 views

REST call for fields: “Type cannot be null”

I'm making rest calls to get a lists fields in a custom JS application. For some reason it's failing when I make the call through the app but when I do it in the console it works fine. I'm using ...
0
votes
1answer
9 views

Provide user a filtered set of managed metadata column values for filtering on a list view

Background/Problem Our customer recently switched from a choice column to using a managed metadata field to capture data in a list. They really love the ability to add new values on the fly, as well ...
1
vote
0answers
14 views

Print Fieldset Expanded Using Javascript [closed]

My HTML is : <input type="button" value="Print" id="btnPrint"> <fieldset id="FieldsetLegal" class="collapsible collapsed"> <legend id="legleg">Legal </legend> &...
1
vote
2answers
48 views

Get user logged on sharepoint online

I need to create notifications for every user who didn't read a specific new on the site. To do this i need to see who user is logged in the site and then save this info into a list on Sharepoint. The ...
1
vote
1answer
54 views

How to encode url in sharepoint using javascript

I have created an html page an used the following javascript to encode url entered in a text box. However, it does not ecode all characters. I used a search url and tried to encode, but does not ...
1
vote
0answers
24 views

Change web page property that's not for the current site

I've tried lots of workarounds and have come up with nothing. I'm trying to do this: https://stackoverflow.com/questions/25595512/javascript-csom-to-access-page-properties But since I need a page ...
1
vote
1answer
47 views

How to get access token to create a list

I'm trying to create a list with javascript. From the Sharepoint API Documentation: url: http://site url/_api/web/lists method: "POST", body: { '__metadata': { 'type': 'SP.List' }, '...
0
votes
1answer
62 views

Caml Query problem, cannot complete this action

I am new in sharepoint development, Can anyone please help me find an error in this query? I am using javascript to retrieve records. The where clause is based on status and priority fields. Query ...
0
votes
2answers
100 views

Make a Chart of a sharepoint list using AngularJS?

I want to implement a Chart of a Sharepoint tracker list. I decided to use angular-chart.js, to use this code I also needed Charter.js. So I downloaded both and decided to make a try as one of the ...
0
votes
1answer
60 views

add attachments with javascript on item edit

I'm using SP Online. I have the following code to update a list item. I added this code in a script editor inside EditForm.aspx. It works fine and I'm able to update several fields, but If user adds ...