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
1answer
22 views

Getting and setting multiple items from a Sharepoint list using CAML query?

I have a SharePoint list Catalog. Using camlQuery I can get a list item value called Price. With the following code I get the Price value of the list element which has the ID 5 and store it in a ...
0
votes
1answer
12 views

Correct camlQuery to retrieve list item value via JavaScript and setting that value in another list

I have two lists: Catalog and Position. I want to retrieve the value of a list item in Catalogand use it for the value of a list item in Position. To get the list items' value Title, I used // Get ...
0
votes
2answers
21 views

JQuery - Set Person Field Value

How to set person field on form load and save the field value when item saves. I have added following code in script editor web part NewForm.aspx. But this is not working. Appreciate your support. $(...
0
votes
1answer
12 views

Date is correct, but String is not being recognized as a valid datetime

I use this to get the current date with one month added to it: var date = new Date(); day = date.getDate(); month = date.getMonth() + 1; month = month + 1; if((String(day)).length == 1) day = '0' ...
0
votes
0answers
4 views

Event after Ribbon tab context/commands load?

In MS Project Server, on the Project Center page, I want to make it automatically show linked sub-projects in the main view. You can get the sub-projects to show by clicking on the PROJECTS tab in ...
0
votes
1answer
30 views

Function adds an element to list every time someone opens a form

I have a form in which a user chooses "Standard", "CAD" or "Manager" which will add an element to a list automatically. The function onChangeMassnahmen() will check if the checkbox is checked: ...
0
votes
1answer
24 views

Jquery not loading on inital page load for suitebar links

I am trying to edit the SharePoint 2016 suitebar links and want to replace "sites" with a custom name and link. I have been able to edit the name via CSS but need to edit the link using JavaScript as ...
0
votes
1answer
25 views

How retrieve managed meta data field values using rest api

I have a SharePoint list which has managed meta data field& lookup field. I want to retrieve the field values and show in HTML table format using rest api.
0
votes
1answer
30 views

How to retrieve the SP list items without using CAML Query?

I have a SharePoint list and I need to get all items from that list without using CAML Query in JSOM. How can I do this?
0
votes
1answer
27 views

Fill SharePoint list element field (people picker) with JavaScript

I want to add a list element via JavaScript which works (almost). After the help from a user here I got this function fillStandard() { console.log("Standard"); var posInvest = "Invest"; ...
0
votes
1answer
29 views

Adding list element via JavaScript gives error

Please note that I'm doing this for the first time. I want to add an element to a list via JavaScript. Therefore, I tried this: function fillStandard() { console.log("Standard"); var ...
0
votes
2answers
46 views

unable to get value of a global variable

I have created one function GetUserInfo which is calling another function GetUserId. I want value of txtAppArchitectId variable to be stored globally so that I can access that after the function is ...
0
votes
0answers
14 views

Why does my autoexpand code in sharepoint calendar sometimes work and sometimes not

Hi All i just want to ask why does the code below sometimes work and sometimes not in auto expanding the sharepoint calendar list. do i need to put a pause on this code to wait the page to load? if ...
0
votes
1answer
48 views

SPFx React webpart onAfterPropertyPaneChangesApplied

I have created simple web-part in react and spfx for sharepoint online. In this web-part weather.tsx have all rendering and function of the web-part. In componentDidMount function I call external API ...
0
votes
0answers
14 views

Javascript to change attributes of native ribbon buttons? (Or another way to select a default ribbon tab when opening forms)

I would like my list forms to open with the browse tab selected by default, to avoid the annoying intrusion of the edit tab drop downs. I've spent most of the day googling and trying various client-...
0
votes
1answer
83 views

Customizing SharePoint list fields in list forms

Currently in my SharePoint (2013 version ) custom list, the list forms are customized to render in tabs format. So each tab has few number of columns/fields in it. Now I have a requirement, in one of ...
0
votes
1answer
53 views

SharePoint passing value of text box on click to update list column

I have a text box on one SP page. Upon click of the submit button, I need the numerical value/input to be sent to a column in a list. I have some coding put together from bits and pieces I've found ...
0
votes
3answers
28 views

How to update a file in a sub folder using jsom

I'm using SharePoint 2013, and I'm trying to make a web part that updates a file's content. I used the script that is offered at this tutorial: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-...
2
votes
1answer
36 views

window.frameElement.commonModalDialogClose(); works in Chrome but not in Internet Explorer

I have a site that opens a modal dialog within it when the site refreshes. To close the modal dialogue via JavaScript I wrote window.frameElement.commonModalDialogClose(); which works perfectly ...
1
vote
1answer
25 views

Calculated Column Working Not Working

I have a calculated column that worked in SharePoint 2007, 2010, 2013, and 2016. But now in SharePoint 2019 the calculated column is not appearing right in the column instead of showing the employees ...
1
vote
1answer
21 views

Creating a new calendar event puts the start date as today's date

When I click the +Add button on my calendar the start/end date/time is being set to the current date instead of the date that I'm clicking on. I believe this has to do with a script I added that ...
0
votes
2answers
59 views

How to Clear Value in people picker in SharePoint Online

I have list in SharePoint Online. With type control people picker. How to delete the value that has been inputted, when approver 1 edit item to return empty. Thanks
0
votes
3answers
37 views

How To Hide New Item from Ribbon Classic SharePoint online?

How to hide New Item menu from classic SharePoint Online Ribbon UI? I am already using Toolbar Type with "No Toolbar". But I want to hide "New Item" button from Ribbon. Please advice. Thanks
1
vote
2answers
37 views

PnP Carousal Control Button style and dots

I have created react carousal from pnp controls, I was looking for help to style next and previous buttons and is there any way to add dots for the slides My Carousal Code public render(): React....
0
votes
1answer
23 views

How do I insert a value in a radio button based choice column in a SharePoint 2013 list using REST API in JavaScript?

Here are the columns I have in the backend list. Here's how I am sending the data to the backend list through a POST request using AJAX. var item = { __metadata: { type: "SP.Data.ListNameListItem"...
3
votes
2answers
197 views

Dynamic view in Sharepoint list

Im Trying to achieve a hierarchal view permission on a Sharepoint custom list. A manager / employee relationship, where a manager in the top hierarchy can see all the employees/managers lists items in ...
0
votes
0answers
30 views

SPFx React Fabric UI Typography and font issue

I am creating react component where in I have created fonts folder inside src folder inside fonts folder I have created fonts.module.scss @font-face { font-family: FS Lola; src: url("/../../../....
0
votes
0answers
16 views

How to display the image from an MS Graph-retrieved webUrl?

I would really appreciate any advice with this - I have a business requirement to retrieve images we store in SharePoint and display them on a Dynamics 365 form. For context I am using an HTML web ...
0
votes
2answers
45 views

How to clear textbox value in SharePoint List using JS

How can I clear value in this text-box with SharePoint List using JS? I am using Approval process where Approver 1 put remarks in this text-box and then saves item. So, when Approver 2 opens the ...
0
votes
0answers
28 views

Sharepoint Online web part loads scripts out of order

I am attempting to embed a hubspot form by creating a Sharepoint Online web part. This is the raw hubspot form code with portalId and formId as placeholders. <!--[if lte IE 8]> <script ...
0
votes
1answer
38 views

SPFX Custom CSS and deploy in CDN

I am creating SPFx extension with custom CSS file not SCSS file. My Question is how can I add path in SPComponentLoader.loadCss()? And at the same time how can I upload the file in my "Public Office ...
0
votes
0answers
15 views

CSP Frame-Ancestors in SPO

We have an AngularJS application running within a SiteCollection. It works fine, but there is one button which opens a new tab to an intranet tool (Dynamics CRM). $scope.openNewTab = function( url ) {...
0
votes
2answers
33 views

How can i insert a css snippet using javascript base on the choices of the user [closed]

I have this HTML and Javascript code. But how can i execute a specific CSS base on the choices below? For example: Platform = Unix, Windows, Network = Execute CSS1 Platform = Unix, Windows = Execute ...
0
votes
1answer
44 views

SharePoint Framework with Promise in extension

I am trying to render header placeholder, but I am very new to the promise of SPFx. Below line in my code runs before it returns any value. How can I await until it returns a string value? this....
0
votes
0answers
22 views

Get document library selected item url in javascript

I have a document library added as web-part to a modern page. Also have a JavaScript added to the page, I want to fetch the item URL of clicked item in JavaScript. Are there any ways to achieve this?...
0
votes
1answer
24 views

Calling document.body.innerHTML+= causes all other JS to stop working

I am attempting to make a very simple web part that allows me to add a <script> tag to the bottom of the <body> element. I am in the stage of using gulp serve to test my part in local ...
0
votes
2answers
17 views

Unable to send a POST request to add a new item

I am trying to make a POST request to add a new item to a SharePoint list in SharePoint online, from a classic page. I am having this code in my custom action: var url = location.href var ...
0
votes
2answers
45 views

Add text to top of DispForm.aspx dependant on specific field value

I need to add the word "Jersey" in red/bold to the top of the Display Form page on a SharePoint online list when 'Jersey' is selected from the 'Location' dropdown field. Please could you let me know ...
1
vote
1answer
19 views

Conditional formatting for a row that contains any information

I have a list that I am using for a library check out. When a person populates the check out date field I want my row to be grayed out. The condition would be if a field contains "any" information. ...
0
votes
1answer
48 views

Stay on NewForm after submitting the form

I have a requirement where Users need to stay on list's NewForm.aspx after submitting the item details. They should be able to create as many items until they click on Cancel without redirecting to ...
0
votes
0answers
20 views

How to display and don't display calendar item base on a specific choice

I have this question last week and it is link below. It is already answered and it worked. what it is about is just base on the choice of a user he/she will be redirected to a specific URL (Sharepoint ...
0
votes
1answer
64 views

_spPageContextInfo in modern pages

Using SPFx extension (application customizer) added JS files to all SharePoint pages (including modern pages), something like mentioned in below blog: Step by Step Procedure to Add a JS file to all ...
0
votes
0answers
11 views

No results found when updating the people picker field

When I want to modify the value in my people picker using JavaScript, it says "No results found" and it don't load the list of persons. but when the people picker is empty, it work and it load data. ...
1
vote
2answers
40 views

Approve/reject workflow with comments client-side

I have a list which has a "SharePoint 2010 Approval workflow" associated to it and would like to provide the use with simple buttons to approve/reject the workflow after it was started. I managed to ...
0
votes
2answers
43 views

How to go to a specific URL base on the choices in dropdown and checkbox

I have this code that when users select a specific value it will go to that URL. But i only have the HTML part. For example: Urgency = High || Impact = Site/Dept || Platform = Unix & Windows ...
0
votes
1answer
31 views

SharePoint 2016 webAbsoluteUrl error

When trying to implement the following code in SharePoint 2016, I get the following error: Unable to get property 'webAbsoluteUrl' of undefined or null reference. The developer tool points to ...
0
votes
0answers
14 views

Dynamic SharePoint Master Page Navigation but scope issue for navigation drop-down

I am having a scope issue and not sure why. I am dynamically creating a navigation with drop-down. It does get created but the drop-down is not rendering even though the caret is showing. I believe ...
0
votes
2answers
32 views

Get list of all content type associated with a list

I am using client code using JQuery and rest API where I have a requirement to bind a drop down control with the content type names associated with a particular list. I am working on SharePoint ...
1
vote
1answer
26 views

Change List Web Part background color when any item in the list has a certain value for a particular field?

Here's my situation. I have a DispForm that has two Data View Web Parts at the top that are displaying a few related items from two other lists. What I've been trying to figure out for hours now is ...
0
votes
1answer
23 views

Update People picker value using javascript

My function is : function UpdatePerform() { var clientContext = new SP.ClientContext(_spPageContextInfo.webAbsoluteUrl); var oList = clientContext.get_web().get_lists().getByTitle(...