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
1 vote
1 answer
431 views

How can I create a new list item in SharePoint with attachments without using jQuery

I am trying to create a SharePoint list item from a HTML file loaded into a SharePoint page. The issue that I am facing is that the business will not allow any external CDN's meaning that any .js code ...
jb12345's user avatar
  • 13
0 votes
1 answer
399 views

Create new listItem with multichoice field Sharepoint Rest Api V1

I'm trying to create a new list item in a SharePoint document library, but I have an error when I set a value in a multi-choice field. This is the body of the post request: { "...
Ghostmaster's user avatar
0 votes
1 answer
76 views

Restructure SharePoint Data Structure After $.ajax GET

So I have gotten to the point in one of my projects where I realize it would be so much easier to have a simpler data structure than what I am actually working with. When I get the data with: _api/web/...
BeerusDev's user avatar
  • 113
0 votes
2 answers
63 views

OpenPopUpPage not showing a popup

I have a SharePoint 19 web part written in React and I am trying to execute a function OpenPopUpPage which displays the content of some calendar events. If I type OpenPopUpPage('http://sp2019/sites/...
AnB's user avatar
  • 37
1 vote
2 answers
812 views

How to display login user name in New Item Form in Custom List

I created one Custom Column name Employee Name it is Person/Group type, when user open New item current login user name show in this column How to do this?
user3520155's user avatar
0 votes
2 answers
35 views

Show different column in New Item form and Edit Item form in Custom list

I created a custom list with some columns in SharePoint 2016 Publishing site. Is there any way to show different column in New Item form and Edit Item form any way OOTB.
user3520155's user avatar
0 votes
0 answers
23 views

How to Show the Colored status or check icon based on column status (yes/no)

I have Custom List for Visitors and I created some custom columns: Visitor Name Enter Time Check Out Time Check Out Status etc.. Here I want when Status column value changes to Yes (this type is Yes/...
user3520155's user avatar
0 votes
2 answers
358 views

Sending Data to SharePoint List From Checkbox HTML Form

I have used a POST before to send list items to SharePoint, although the only items that were included were text inputs so I could call the #id of that input and create the value like so: var item = { ...
BeerusDev's user avatar
  • 113
1 vote
1 answer
225 views

SharePoint 2013 how to run JavaScript or jQuery for calendar add event popup window

I have a calendar app created in SharePoint 2013, I want to Autofill Location text field in popup window of add new event. How can I do it with help of JavaScript or jQuery?
Azad Kolachi's user avatar
0 votes
3 answers
543 views

Recursive function to handle list view threshold not working

We have a list with 0.5 Million items. The end goal is to get and handle threshold using recursive function. Followed the below article however didn't work as per our requirement. Rest to read more ...
Vivek's user avatar
  • 37
0 votes
1 answer
204 views

spfx React - include javascript assets in sppkg

I create my package with this command gulp clean gulp build --ship gulp package-solution --ship in my sppkg there aren't javascript files in package, and when I deploy this in the app catalog, and ...
GioP's user avatar
  • 11
0 votes
1 answer
154 views

SP.UI.ModalDialog.showWaitScreenWithNoClose TypeError: a.indexOf is not a function

I'm getting TypeError: a.indexOf is not a function when calling showWaitScreenWithNoClose(). I'm trying to wait until all necessary scripts are loaded, my code is essentially: $(document).ready(() =&...
Dylan Cristy's user avatar
  • 12.5k
0 votes
2 answers
423 views

Create a list item using Sharepoint REST API and HTML

I'm working on SharePoint Server 2016. I have a modal with some input fields and a Submit Button. And I used jQuery to extract text from input fields in Modal. When I click on Submit, nothing is ...
Venkat Sai's user avatar
1 vote
2 answers
53 views

If somebody choose a value from choice field in NewForm, then pop-up window or notification is displayed

Is it possible in SharePoint (I use Classic Experience) to display a notification, when somebody choose particular value from choice field in New Form? For example, I've a choice field in New Form, ...
analyzer64's user avatar
0 votes
1 answer
31 views

Javascript isn't being loaded correctly

I have a very simple html file that displays a new image every 2 seconds. I am pretty sure my code works, I can open the file in a browser and everything is as expected. However, when I put it in an ...
Intern_Is_Confused's user avatar
0 votes
1 answer
825 views

SharePoint REST API - Return current user list item permission level with item data

With an items query like this: _api/web/lists/getbytitle('Docs')/items Is it possible to also include what permission level the current user has on a given item? My list items have unique permissions, ...
hilary's user avatar
  • 220
1 vote
1 answer
73 views

Sharepoint and JavaScript - if one field has different value from second field, then hide third field

I am noob in coding in JS and SharePoint, I've to check two conditions in NewForm.aspx. If field, for e.g. "Name" has value "Test", and field "Second Name" has value &...
analyzer64's user avatar
0 votes
1 answer
267 views

SPFx WebPart vs hosting plain HTML/Javascript page

I would like to know what are the advantages of creating a SPFx web-part instead of just hosting a custom html page with react on SharePoint 2019 on-premises. Thanks
Filippos Nikolopoulos's user avatar
0 votes
1 answer
35 views

Add custom javascript to application page

Is there any way to add JavaScript to a custom application page that is deployed to _layouts/CustomFunctionality/ without any server side deployment ? I have a custom NewForm.aspx where I need to add ...
David's user avatar
  • 39
0 votes
1 answer
800 views

How to call graph API to read SP list items from SPFx in SP Online?

I'm new to graph API and trying to use graph API to read SP list items from a custom list using the current user's rights (not service account). But I'm getting an error. I have this so far: In the ...
omega's user avatar
  • 2,150
0 votes
1 answer
279 views

HTML showing up with inserted text via REST API

I am getting the value from a text field and then inserting the value into a SP list. The problem is that when I check the console the field shows HTML. var txtField = document.querySelector('#...
martinbshp's user avatar
0 votes
1 answer
86 views

JavaScript CRUD operations in Provider Hosted Apps SharePoint Online

I am new to Provider Hosted Apps and starting off with the basics. Was able to save the data to the list, However facing challenges with edit, update and delete. Scenario: Created a simple form with ...
Vivek's user avatar
  • 37
0 votes
1 answer
118 views

AddListItem is not populating the List in SP2013

I have a knowledge check in HTML form, so I cant inject into CEWP or SP pages. It needs to be JS, CSS, and HTML. How do I populate a list if someone completes a Knowledge Check? It will add the score, ...
Lance Bitner's user avatar
0 votes
2 answers
61 views

Unable to Access multidimensional array elements of SharePoint CAML query

The following code outputs a comma separated array for the var cats. The array has six items as the list "banner" has two columns and three rows of items. I can access the array items in the ...
bryan0920's user avatar
1 vote
0 answers
304 views

How to determine user logged in and session not expired in SharePoint using JavaScript

I created a clientside application for SharePoint using javascript and jquery. We use Rest API for CURD operation on SharePoint Data and config Idle Session Timeout for the inactive user. After a user ...
m0st4f4's user avatar
  • 31
1 vote
2 answers
188 views

Using javascript I need to highlight a row if it is within 14 days of becoming due via due date, and red it if is past due or today

So I have this code that I found here at Stack Exchange that lets me highlight rows based on date: SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function () { ...
Mike's user avatar
  • 11
0 votes
1 answer
26 views

Passing calculated value to become new item in SharePoint list

I've created a crossword game based on this: https://github.com/trutex/jCrossword. I added a script to score the game (1 point per correct answer). Goal: when the user has answered all the hints they ...
mrsgorgon's user avatar
0 votes
1 answer
50 views

OnClick the function behind it runs but values are not displayed in the form (webForms)

I am not sure why this is happening it is working alright on my other form which have almost similar code. Button <td> <asp:Button Text="Proceed" ...
Imdad Khan's user avatar
1 vote
0 answers
61 views

SharePoint 2019 javascript SP.MoveCopyUtil.copyFile not working across site collections

In SharePoint 2016, I was happily surprised to benefit new javascript functions available in SharePoint : SP.MoveCopyUtil.* to get out of the hell of copying files in SharePoint. The following peace ...
user21090's user avatar
1 vote
1 answer
799 views

DevExpress Custom Store to get data from REST API

I'm trying to create a drop down menu using DexExpress in jQuery with SharePoint REST API. I get the values from the REST call in the console, but I'm having issues trying to display these values in ...
CXLSX's user avatar
  • 13
0 votes
2 answers
167 views

How to add button to SharePoint 2013 ribbon using JavaScript

Is it possible to use JavaScript to dynamically add a custom button to the ribbon? I want to add a button next to the upload document button in a document library. Any ideas or code how to do that?
jlai's user avatar
  • 660
0 votes
1 answer
62 views

What is the minimum permission needed for the client side people picker to work for a user

I have implemented client side people in SharePoint 2019 site in a custom form using plain HTML and jQuery. Requirement is to give user enough permission to use people picker but restrict from add/...
Pranav Joshi's user avatar
1 vote
1 answer
27 views

Running an application setup script using content editor

Preface, I have absolutely no experience with SharePoint (we use 2016) and I've received tasking that requires me to set some things up. Basically, my org wants to set up a stress test application on ...
Jack's user avatar
  • 11
0 votes
1 answer
3k views

Using Filter Query in Graph API to fetch the particular users

Current code: public render(): void { this.context.msGraphClientFactory .getClient() .then((graphclient:MSGraphClient): void=>{ graphclient .api('/users') .filter('Department eq IT') .get(...
abhishek23 Negi's user avatar
1 vote
0 answers
49 views

GraphAPI send invitation to external/guest user for a specific SharePoint site

Language: JavaScript - MSAL library Scope: GraphAPI Is there a way to send an invitation to an external user thorough GraphAPI that will be valid only for a specific site. Currently I am using the ...
JohnRambo's user avatar
  • 187
0 votes
2 answers
466 views

Adding space between radio buttons

is there any way we can add space between the choice fields (Radio Buttons)? For instance if I want to make space between Youth and Adult what would be the steps?
Harris's user avatar
  • 547
0 votes
1 answer
209 views

How to get document library in webpart property using no javascript in spfx

I am trying to get document library in webpart property using no javascript in spfx. How can I retrieve in drop-down.
SHREYA SINGH's user avatar
0 votes
2 answers
138 views

How to filter list and Document library in java-script [closed]

How to filter the list and document library from SharePoint using base-type?
SHREYA SINGH's user avatar
0 votes
1 answer
43 views

Request next available item from sharepoint list with jquery

I have a sharepoint list with two columns, one with one time codes and the other one is yes/no Like this: CODE USED NGTHX–EVLRZ–GHTXD Yes RYKXB–EOMWD–FZUWL No DKTUN–YSCWP–PHKWM No So what I'm ...
SuperDOS's user avatar
  • 103
0 votes
0 answers
18 views

Cannot save FieldUserValue. Error: "Invalid data has been used to update the list item. The field you are trying to update may be read only."

this is my code: var context = new SP.ClientContext.get_current(); var targetList = context.get_web().get_lists().getByTitle("reqLegales"); //my list context.load(targetList); var item = ...
Walter Di Biase's user avatar
1 vote
2 answers
844 views

Conditional formatting help SharePoint 2016

I am trying to apply conditional formatting to my calculated field "Days" i would like for the following conditions to trigger the formatting. i cant seem to make it work. below is my code ...
Newb's user avatar
  • 41
0 votes
1 answer
18 views

Custom JS Interfere with Workflow?

I have noticed once I added custom JS to my SharePoint page, one of my workflows stopped working (it sends email alerts). I checked it in Designer and it says no errors?
BeerusDev's user avatar
  • 113
0 votes
1 answer
159 views

Modify my SharePoint Framework Extension to only run on the home page of the site + add a custom JS file

I am working on a SharePoint online modern team site, and I am following these steps to inject custom CSS inside my pages @ https://tahoeninjas.blog/2018/05/08/inject-custom-css-on-sharepoint-modern-...
John John's user avatar
1 vote
1 answer
1k views

403 when making axios POST request

I have a feature that loads a map onto a page, and 5% of the time I'm hit with a 403 error and the map data doesn't load properly. I've had a very difficult time with triggering the error, but I was ...
Bodrov's user avatar
  • 111
0 votes
1 answer
98 views

Hiding the Stop editing link when the QuickEdit grid is closed in SharePoint

I am trying to replicate the "Stop editing this list" link that is at the top of the page when in QuickEdit Mode. My link will be at the bottom. I want to the hide the when not in QuickEdit ...
Edward's user avatar
  • 1
0 votes
1 answer
287 views

filter column with last 4 digits using restapi

We have a column where the values are stored as '1002859817' and the Field Type is single line of text. The end goal here is to filter the column based on the last 4 digits i.e. '9817' Tried the ...
Vivek's user avatar
  • 37
0 votes
0 answers
142 views

Where is the NewForm, DispForm, and EditForm on SP 2019?

Trying to find out where the New, Disp, and Edit form pages are on SP 2019. Migrating from 2016 to 2019 and we had some customized forms using JavaScript. The 2016 pages used CEWP to add the ...
adams-j's user avatar
  • 307
0 votes
1 answer
207 views

Batch Update for 16K Items failing

We are trying to copy contents from one column to the other , However we get request digest error after 6K Items. Below is the code $(document).ready(function () { $("#btnSubmit").click(...
Vivek's user avatar
  • 37
0 votes
1 answer
79 views

SP2013 Custom List - Date & Time Column

I have created a custom list on which both date and time needs to be captured on two specific fields. To comply with existing custom formatting on the new and edit forms, I need to re-size the three ...
Matt's user avatar
  • 3
0 votes
1 answer
64 views

Copy Input Box to SharePoint input

Is it possible to get the value in the textbox value I created in Script Editor to copy over to Title? I would like for the text I type to automatically copy over to the Title box that is part of the ...
williswin's user avatar