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,324 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
26 views

Expand the cell/grid width and height in the calendar

Kindly help me with this urgent task. I want to know how to increase the grid/cell size in the calendar. The current cell/grid/block are two small for my requirement. I want to expand them per day ...
1
vote
1answer
29 views

How to restrict certain users to see the attachments attached with a sp list item

I am working with SharePoint 2013 on prem and I have a custom list created where users store certain info relevant to their contracts. I have not implemented permissions for this list yet, but it will ...
1
vote
0answers
12 views

Using ClientContext can we change the url of text file linked to content editor webpart?

Is there any way to change the url property of content editor webpart using Javascript function ? I found solution to change the title of the webpart not the url properties of the web part. ? ...
1
vote
0answers
40 views

How to create 3 rows and 3 columns inside each row in java script?

Hello I have been trying to do this for a while but the end result is always the same. The code I wrote fetches the items from a list and put them all in one row. The idea is to put 3 items per row. $...
1
vote
0answers
40 views

SharePoint 2016 - Polygon in SVG (clickable)

at the moment I try to develop a SharePoint 2016 Visual Web Part project (my first time). I define the content from this Visual Web Part withe JavaScript, becaue I have to build a SVG element by ...
1
vote
0answers
55 views

Cannot upload attachment to SharePoint list item using JavaScript

I am trying to upload the email attachment to SharePoint list item using JavaScript. But I landed up on the following error on the console. Cannot rename "_120" to "120": destination already exists....
1
vote
0answers
20 views

Change row limit on webpart with JS or AngularJs

I have a webpart wit row limit 9, and a widget that displays me a table with different numbers. I want that table to continue to show me the 9 rows until a date, and after that date to show me 5 rows. ...
1
vote
0answers
16 views

Can I use libman with my SharePoint Add-In project?

I've noticed that libman is only available in Visual Studio 2017 asp.net projects. However, SharePoint Online Add-In projects are also web projects and use lots of javascript libraries. Is there any ...
1
vote
1answer
62 views

Limit edit in SharePoint List to only 3 Items per user

I need to limit the possibility per user to be able to edit 3 drop down value items from the quick edit mode option in a SharePoint list(when pressing "edit this list" that is next to the new item ...
1
vote
0answers
135 views

The maximum number of bytes allowed to be read from the stream has > been exceeded

I'm trying to create a list item through REST api, but the multitext field contains content larger than 1mb and I'm getting this error: "The maximum number of bytes allowed to be read from the ...
1
vote
0answers
54 views

JSOM - Load items with fields

I've got an issue when loading data with the jsom (JavaScript). I've included all fields, I want to load: this.context.load(this.items, 'Include(ID,DocIcon,LinkFilename,FileRef,FileLeafRef,Title,...
1
vote
2answers
36 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
49 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
0answers
36 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 ...
1
vote
0answers
18 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
40 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
222 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
1answer
94 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 ...
1
vote
2answers
203 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 ...
1
vote
1answer
211 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
1
vote
2answers
362 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 ...
1
vote
0answers
27 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
0answers
65 views

SharePoint promoted links on multiple rows with scrolling

Is there a way for SharePoint to displayed promoted links in 2 rows and still maintain the scrolling feature? When I added this script to display multiple rows I lose the scrolling feature. script ...
1
vote
0answers
44 views

Closing modal dialog, script error

Using jquery I'm opening a SharePoint page in a dialog, this works perfectly fine. Now on that page I have a button to submit a custom form and finally close the dialog again. While this works when ...
1
vote
0answers
40 views

Save document template from AppWeb to HostWeb document library

I am trying to create SharePoint app. Basic idea is to create document in hostweb document library from AppWeb (document template stored in AppWeb doc lib). In Details : I have created ribbon ...
1
vote
1answer
32 views

Need timestamps for the completion of each stage in a work process flow

I'm using a MS SharePoint-based Intranet site to track and report the status of a requisition as it moves through its review processes. There are six stages in the process flow and, for performance ...
1
vote
0answers
48 views

Automatically add the “fill-in” value from the Choice column to the dropdown list

I wish Microsoft included a second checkbox for the Choice Column labeled "Capture 'Fill-in' choices" that would automatically add the user's fill-in choice to the dropdown list. I'm using SP2013. I ...
1
vote
1answer
83 views

How to set serverProcessedContent in a ClientSideWebPart

I'd like to add a file viewer web part to the home page of my online modern site via an SPFx Part. To try to make things easier, I have a fully configured file viewer part with an Excel file on a ...
1
vote
0answers
115 views

Cannot clear people picker through Javascript

I've generated a people picker and I'm trying to clear it when i reset the form but it keeps giving me this error: clear: pickerId => { var picker = ...
1
vote
1answer
234 views

SharePoint 2016. Change custom upload location to current document set

I have implemented a custom upload button on a modified 'docsethomepage.aspx'. The new page shows the properties of the DS. I would like using javascript to upload the file to this Doc set instead to ...
1
vote
0answers
134 views

How can I remove the option of 'Save and Close' on the Survey sharepoint app?

As above from the question, would like to find out if I'm able to remove the option, 'Save and Close' in the Survey app form? Thank you!
1
vote
4answers
110 views

conditonal formatting working on lists and not libraries?

Any reason why this code works on a list in a page and not on the list of pages (Pages library - PAGES) displayed on a page? The 'cell' (ms-vb2) is the same in both cases. <script src="https://...
1
vote
0answers
25 views

Custom Web part with filter that doesn't cause postback

I have a custom Content Query Web Part that currently pulls in events into a custom calendar, by month, with selectable filters that filter event listed on the calendar by a field value on the Event ...
1
vote
0answers
29 views

Create cursor when hover on cell

I tried this code to change style of the cell on jsgrid: JsGridControlInstance.parentNode.jsgridparams.styleManager.RegisterCellStyle("Important", SP.JsGrid.Style.CreateStyle(SP.JsGrid.Style.Type....
1
vote
1answer
49 views

Automatically activate sharepoint framework extension on all subsites(modern pages)

I want to use simple js script on my intranet Sharepoint Online modern page. I used this tutorial and everything works decent, but when I create subsite mine js script just does attach. How could I ...
1
vote
0answers
33 views

Allow Only One User to Submit SP Form

I know this should be able to be possible but do not know where to start. I am working in sp13 and created a custom list. The custom list form I want users to be able to submit one form and not be ...
1
vote
0answers
53 views

Parent/Child List: go back to Modal Parent dispform after child form submit/save

My need is very close to something already treated like this topic but the solutions doesn not seems to work on Modal/Dialog forms. In my context, I have a parent list ("projects") and a child list ("...
1
vote
1answer
55 views

How do I edit colum in SharePoint Online using JavaScript?

Hope you're well; What is javaScript code to add on SharePoint list for showing a few lines of text per row so they all the same size where reams of text have been written this is via scroll or ...
1
vote
0answers
53 views

How to read returned values from XMLHttpRequest call?

I am using SharePoint 2013 on-prem. I am having a problem with my XMLHttpRequest. I do not want to use a jQuery wrapper so I need help getting the below to work. How do I get to the data? Also, my ...
1
vote
0answers
177 views

Fetch values into dropdown list column based on query from another list - jquery

Please help me with some code (preferrably jquery). Sharepoint 2016. I have List 1 with columns Resource, Attribute1, Attribute2,..., Attribute10. And I have another List 2 with columns Project, ...
1
vote
1answer
156 views

How to call a function when user enter name in SharePoint People Picker

Need to grab user email from SharePoint people picker and show an alert. I have tried below options but unable to get an alert after adding the name in people picker. var supervisorPicker = ...
1
vote
0answers
27 views

How to apply cascading in below scenario using JSOM?

I Have a requirement to leverage Cascading in a little tricky way and which is where i need help. The Project I am working on, there is a Custom list called 'Company List', please see below screenshot....
1
vote
0answers
28 views

Execute Asynchronusly in for loop in javascript to retrive sharepoint list items

I want to retrieve list items based on passing values to query from array. Due to asynchronous functionality its not reading all the items. Below is the code for(i=0; i<= DepartmentIds.length; i++...
1
vote
0answers
122 views

Cascading Dropdown List Issue

i have 3 custom list. i Called it Area, Disiplin1 and WBS. for Area and Disiplin1 i set lookup to WBS column and i have create a script. but if i try to create new item, the cascading is not correct. ...
1
vote
1answer
53 views

SharePoint Custom Form Hide or Show questions

I have a SharePoint custom list application with forms modified in SharePoint designer. I am looking for a way to hide or display questions on the form based on other form questions. Example: Lets ...
1
vote
0answers
202 views

Batch requests with the REST API: Is it synchronous or asynchronous?

Simple question: is the batch request in the SharePoint 2016 REST API asynchronous or synchronous (for clarification: the multiple requests inside one batch are handled one after one [synchronous] or ...
1
vote
0answers
2k views

Unexpected identifier on javascript import statement

I'm getting the following error when trying to implement Google Analytics reporting in a Sharepoint site page. Uncaught SyntaxError: Unexpected identifier view-selector2.js:19 (js file and line ...
1
vote
2answers
76 views

How to get the name of a selected web-part in javascript?

I have some javascript that runs when a button is clicked. It processes the items that have been selected in a list web-part. However, I want to have two list web-parts on my page that refer to two ...
1
vote
0answers
45 views

why all the Div have been effected when i define a CSS rule (using javascript) inside my New list form

I have sharepoint on-premises 2013, and i have add the following javascript inside my New list form. $(document).ready(function () { function init() { $('input[id^="SupplierCost_"]').change(...
1
vote
0answers
230 views

Get JWT Tokens in SharePoint Online

There is a function in Outlook API called getCallbackTokenAsync([options], callback); Office.context.mailbox.getCallbackTokenAsync How can I get such function in SharePoint Online? Is there an ...