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
2answers
85 views

No Masterpage/CSS Access. Need to programatically set up drop down menu on TOP Nav bar for Team Site w/o Publishing

First off, my limitations. I do not have access to the master page(s) or global css (either using SPD or not...). Nor do I have the ability to use managed or global navigation. This is a Team Site and ...
1
vote
1answer
26 views

JavaScript to hide sharepoint fields reruns when form is submitted and required fields are missing

Thank you for taking the time to read my question. I have a simple script in a SharePoint NewForm.aspx which initially hides a field on the form and then displays it if Yes is chosen in response to ...
0
votes
1answer
41 views

create a SharePoint list using a button in Javascript

Here's my code. It validates, but btn on click doesn't do anything. <button onclick="createList()">Click here to create a list</button> <script> function createList() { var ...
0
votes
2answers
54 views

Change the background colour of a cell - not highlighting text

I'm using the script editor to format my list. When I use this block of code: function boldTemplate(ctx){ var value = ctx.CurrentItem[ctx.CurrentFieldSchema.Name]; switch(value){ case ...
1
vote
1answer
144 views

axios SharePoint error in IE 11 but not Chrome

When I use axios with SharePoint, it successfully works in Chrome but not in IE 11. The error is 'Promise' is undefined. Using the polyfill does not work either. Any ideas? Code below: window....
1
vote
1answer
51 views

Sharepoint 2013 - issue with using java script to format columns

I found a few tutorials to do this, many of them point to using the jslink or content editor. I tried following the instructions in this site: CSR code samples #1 (Task Priority color) but it's not ...
0
votes
1answer
60 views

Customized Spell Checking

My users do not like the way the spell checking works in SP. They basically want the Microsoft Word experience where they right click on a word and can automatically add it to a list. While I ...
2
votes
2answers
68 views

Custom 'Open in explorer' Button

I'm trying to add a custom 'Open in Explorer' button to the page using Content Editor Web Part. This is the code I've found and tried with no success: <a href='#' onClick="javascript:CoreInvoke('...
1
vote
1answer
40 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 ...
0
votes
1answer
12 views

Adding webpart to page using javascript - which permissions are needed?

So I have a script up and running for the users easily to add a predefined webpart to a page (Like described here) - now it would seem my users havn't got access to actually execute the script. I have ...
0
votes
3answers
315 views

SharePoint Online List Accordion

I am needing to create an accordion in SharePoint web part for online, however I am quiet new to JS & Jquery. Is there an example of an accordion that I can use to help this? The items must be ...
1
vote
0answers
59 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
224 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
1answer
180 views

How to get site ID without access to central admin or powershell

I was trying to follow this post for setting the owner of a SharePoint group using client side code. Evidently the REST /_api/web/sitegroups(id)/owners endpoint isn't functional. The XML formatting ...
0
votes
1answer
17 views

Count entries in a list depending from the current user

I have a list (Teamsites) in SP 2013 onPrem with a people picker field (Owner). Now I want show a counter of all list entries where the current user is standing in the Owner-Field. How i can ...
1
vote
1answer
56 views

SharePoint online File editor no longer has save button

starting last wednesday I lost the ability to save changes I make to my HTML/CSS/JS files in the file editor. They allow me to "Open in Text Editor" but the Save button never appears at the top of the ...
1
vote
0answers
44 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!
0
votes
1answer
207 views

Uncaught TypeError: Cannot read property 'results' of null

My column Jurisdiction is a multichoice column. My program is as below : for (var index = 0; index < ArrayRetrieved.Jurisdiction.results.length; index++) $('#jurisdiction option[value="' + ...
0
votes
1answer
77 views

How to add a DataTable with Drop-down Select Menus

Can I add drop-down select menu to my data table plugins? When I filter Issue_x0020_Status as Active, Resolved and Closed it only shows what ever the user filter. This is my page And Similar to this ...
0
votes
3answers
82 views

Call a executeQueryAsync function inside success of a function

I am able to fetch single SharePoint List using JavaScript. But here I need to Query other list based on the value fetched from first list. I have also used angularjs for the page. Find the below ...
0
votes
1answer
109 views

How to change null value to empty using REST

How to change null value to empty string in Sharepoint custom script? Here is my code. $(document).ready(function() { getUserListItems() }); function getUserListItems() { var ...
0
votes
2answers
83 views

How to get current user's permission levels (javascript)?

I need to get approve , edit and read permissions for a site .How can i find this?
1
vote
1answer
129 views

Article pages: is there a way with a code to 'write' one or more fields inside the page?

The Article page has a lot of properties that might be useful to read on the main page and not as a 'property' of the page only. Is there a code to occasionally surface any value (contact, Modified, ...
0
votes
1answer
49 views

Using script editor to apply hover effects to certain images

I'm trying to apply some hover effects to some images on a page. I'm using the Modern script editor from here. I can't get the code right. The image is in this <div class="...
0
votes
1answer
47 views

Sticky custom nav for SharePoint

I was looking to create something like the sticky top bar that appears when you scroll the page. I tried following the instructions from w3schools and codepen. Also read a post about $(window).scroll(...
0
votes
2answers
59 views

I'm trying to get the values of the selected checkboxes in Sharepoint and store them in an array and pass it to POST request

I have tried the following code. I'm not sure where I'm going wrong. I have multiple checkboxes in my sharepoint form. Can somebody help me with this? $(function () { var checkedAttr = []; ...
0
votes
1answer
35 views

How can I hide unselected (web part connection) list items?

Team, Scenario: I have two web parts that are connected with a connection filter. When I select an item in list A, related items in list B are filtered. Hooray! But list A is really long, so when ...
0
votes
2answers
196 views

SharePoint radio button value

I am trying to get the value of a selected radio button from my list form. There are three radio buttons. I noticed that when I get the value, I get a sharepoint generated value such as 'ct100', '...
1
vote
4answers
88 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
1answer
89 views

Update attachment file in SharePoint using custom JavaScript

Anybody know how to update attachment file in list item using javascript? Any idea are so much appreciated.
0
votes
1answer
45 views

JSOM - Page Approval with JS

I write down a JavaScript to reset news likes. It is working properly. But I need to checkOut the file while trying to edit news properties. ResetNewsLike = function () { var pagesListItem = ...
0
votes
1answer
67 views

Sort list from camlQuery

I am using SP.CamlQuery.createAllItemsQuery() to grab all items from a custom list in SharePoint, however even though the list itself is sorted in an alphabetical order, when it comes through to a ...
0
votes
1answer
76 views

How to know if 'ms-CommandBar' component has been loaded using SPFX extensions

I would like to hide the above commandbar in all pages using javascript in spfx extensions(application customizer). I have tried the below code @override public onInit(): Promise<void> { ...
0
votes
0answers
27 views

How to convert any document to pdf and upload into document library using sharepoint add-in?

We successfully uploaded the file using sharePoint add-in But how to convert it to pdf directly and upload a pdf file to SharePoint document library?
0
votes
2answers
166 views

How can i get Current User's permission levels, Current User's SharePoint group by code (Javascript especially)?

I want to get Current User's SharePoint groups by programmatically.How can i get this information?
2
votes
2answers
131 views

Get Current User using SPUtility

I want to check if current user = "xxx" and make the field "yyy" as Read Only. $(document).ready(function () { var userName = $().SPServices.SPGetCurrentUser(); if(userName == "xxx") { ...
1
vote
2answers
46 views

How to install and reference libraries for JavaScript CSOM in SharePoint?

I am very new to SharePoint and have written some code,in content editor web part, that interacted with lists and used some libraries that are available online like jQuery etc., my question is how do ...
0
votes
1answer
48 views

HTML WebPart dropdown a custom list

I have a content editor web part that is referencing an html page. How can I fill a dropdown on that html page with the contents of a sharepoint custom list column?
0
votes
0answers
17 views

Filter to query SP.UserProfiles.PeopleManager AJAX / REST

I'm trying to find the account name for a specific property in my organization that has been mapped to the userprofiles. It's not part of the siteusers profiles, but has been added to SP....
1
vote
1answer
32 views

Adding a webpart from gallery to page using javascript

Would anybody be able to help me out on how to write a javascript snippet to add a webpart fra the gallary to a page using javascript? I have tried several different solutions found here and ...
0
votes
1answer
42 views

Rating Feature not disabling on SPO Pages - SharePoint Online

I have a requirement where Admin will have the ability to turn ON/OFF the rating feature for SPO Pages and the UI Control should be able to display/hide based on the setting. Steps for turning ON ...
1
vote
0answers
23 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 ...
0
votes
3answers
51 views

What is a better way of writing this code? (JQuery which displays x list form rows based on a number entered by the user).

I'm working with a SharePoint 2013 NewForm. The list it relates to contains fields to hold information about batch files that being submitted, 4 fields per file. (So if 2 files are being submitted, ...
1
vote
0answers
27 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....
0
votes
2answers
53 views

how to tell js that a colum value is changed?

i'm trying to set an step progress bar inside an item, but i couldn't make it dinamicaly because i can't catch if the field value is changed. so, can someone tell me if i can call the function when ...
0
votes
1answer
34 views

How to add validation field in every input type or required fields

Here is my JS. function addItem() { //Radio Button var tipo = document.getElementsByName("priority"); for (var i = 0; i < tipo.length; i++) { if (tipo[i]....
0
votes
1answer
37 views

Retrieving info about the current logged in user via Javascript

I'm trying to query the User Profile for the current logged in user. Per examples I've seen, I should reference the SP.UserProfiles.js file in my executeOrDelay call: SP.SOD....
0
votes
2answers
312 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 ...
1
vote
1answer
564 views

Save and Submit functionality in new form of SharePoint online list

I have a requirement where if user comes to fill new item form, user should stay on the new form itself on click of 'save' button and once he click 'submit' it will get submitted. Technically on click ...
1
vote
2answers
56 views

This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator in SharePoint online

I created Indexed columns for this list but i am still getting this error "This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator". I ...