Stack Exchange Network

Stack Exchange network consists of 175 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
0answers
21 views

Send mail to specific persons using Javascript

My Need: If ATitle=="" send mail to Person B,C,D,E If ATitle=="" && BTitle=="" send mail to Person C,D,E WE have to send mail only to the persons where Their Title is not null. $('#...
0
votes
3answers
68 views

Get List Item ID for file in Document Library

I've got a document library which has folders in it. I can get a given folder and iterate through the documents in the folder via REST just fine. What I need to do is get some of the list item ...
0
votes
0answers
13 views
0
votes
1answer
21 views

How to Add multi lookup field client object model using javascript sharepoint?

I will add multi Lookup values: var items = List.getItems(camlQuery); clientContext.load(items); clientContext.executeQueryAsync( function(sender, args) { var itemEnum = items....
2
votes
1answer
46 views

upload file to SharePoint Online via REST API issue

I have a highly customized Edit form for a list. To make life easier for users, and to manage the size of the list better, instead of attaching files directly to the list, we set up a documents ...
0
votes
2answers
38 views

Force A SharePoint Online Link To Always Open A New Tab In Chrome On Button Click No Matter In Which Browser The Page Is Opened In

I need to force a SharePoint online link to always open a new tab in chrome on button click no matter in which browser the page is loaded in. Any ideas how to achieve that. Was thinking something ...
0
votes
1answer
30 views

How Add Tab ability to Content Editor Web Part?

Hope you're well; I would like to know how I can add tabs in Content Editor web part in SharePoint Online. What is best solution to this. kind regards, Anees
0
votes
1answer
31 views

Calculated Columns with Conditions

I have found plenty of posts that mentioned how to add multiple conditions to calculated column but my formula is not working. The action is pretty simple that is why I feel like silly that it has ...
0
votes
0answers
26 views

SharePoint List Accordion with Search

I am kind of new to JavaScript. However with other references I was able to call a list via Rest API and convert it into an accordion. Now, I need to be able to search and highlight the terms being ...
1
vote
1answer
78 views

Object doesn't support property or method 'readAsBinaryString' IE 11

I am using xlsx.core.min.js to upload excel files to SP and pass their contents to a new list. I have it working in Edge but it will not work in IE 11. The first console error I received was "Object ...
1
vote
1answer
53 views

how to add lookup value sharepoint online

How to add lookup value (Title ) column "achat" : lookup field enter c if (itemEnum.moveNext()) { // update the item var current = itemEnum.get_current(); // add lookup field var ...
1
vote
1answer
21 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
1answer
18 views

Retrieve a Value From A List Based On Who Is Logged In

I currently have the vacation days for all the employees saved in a SharePoint list. I would like to display the number of vacation days the employee that is logged in has on the Home page. For ...
0
votes
0answers
12 views

Unable to append to modal using PnP.js and Ajax

I'm unable to append a certain div to a modal when pulling in data using pnp and JavaScript. The whole process explained: Function DomyApiCalls - WORKS (Pulls in all the boxes with the titles) ...
1
vote
1answer
23 views

How can I get a subfolder's GUID which is under a document library with soap and javascript or CAML query?

I want to fetch this subfolder's documents. but CAML is not showing the documents clearly . thak you.
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
1answer
36 views

Sharepoint 2013 sweetalert2 ie doesn't work

I was making a small notice board for users with sweetalert2. it is working well chrome. Testing with little script trigger button its working good chrome but still not showing ie. I have to say my ...
1
vote
1answer
35 views

Add sharepoint menu ellipsis to end of Document Library using javascript

I have a document library in SharePoint 2013 with a number of different views and I want to add the menu ellipsis (...) at the end of each view by using javascript in the masterpage. I know how to do ...
2
votes
1answer
56 views

Using TypeScript global variable with SharePoint functions

Using TypeScript and Angular, I have created a function named getTasks() that I want to fire when a modal is closed. This is the function: getTasks() { this.http.get(`https://example.com/_api/web/...
1
vote
1answer
16 views

implementing sharepoint permissions by content type

I am working with SharePoint server 2013 on premises. Regarding one of the implementations, I am using an OOTB custom list. For permissions, I have it setup by SharePoint groups: Finance Members, HR ...
0
votes
1answer
75 views

Force template download instead of opening file using code

I have a Templates document library, where the piece of code below has happily forcing the download of a template document instead of the file been opened. However, it has stopped working. The ...
2
votes
0answers
18 views

Custom validation for people editor control

How to add custom validation for in asp.net if the user adds more than one username an error message must appear that he can only add one user. Thanks Regard.
1
vote
1answer
21 views

Dynamically Constructed JSON/Javascript Object Will Not Stringify

I am trying to take selected listed items and pack specific data values from them into either an array or JSON "object" to then stringify and store in local browser session storage so I can pass it to ...
1
vote
0answers
33 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. $...
0
votes
0answers
29 views

SharePoint how to upload file using javascript

I just want to use SharePoint to upload files to it and downloading from it without getting into any add-in or whatsoever business(just for storage). But to test JavaScript code from the official ...
1
vote
0answers
23 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 ...
2
votes
1answer
18 views

Order By Ascending with CamlBuilder()

How to write a function to order by ascending: true for date field. There is a picture library in our site. I find .OrderByDesc('year'), but I need it's opposite: var query = new CamlBuilder() ...
1
vote
2answers
38 views

Need to have buttons on InfoPath form in a Site Page to direct to a specific URL

I have an InfoPath Designer form that I created and placed into a Site Page. Now I would like each of the buttons on this form to be able to direct to specified URL. I've tried adding the script below ...
1
vote
1answer
33 views

CAML Query with more than one condition

Hi I am currently writing a sharepoint add in application which reads and writes to sharepoint lists. For one of the lists I want to retrieve a list item based on the user logged in and also based on ...
1
vote
0answers
27 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
1answer
47 views

How to expand person lookup field?

How do I select all the fields and expand a person lookup field using the pnp js library? $pnp.sp.crossDomainWeb(addinweb, hostweb).lists.getByTitle("Sites").items.select('*').expand('Person Field')....
0
votes
0answers
15 views

Can I generate an app user context token in javascript running in a CEWP and pass it to a back end .Net API and run SP REST API queries using it?

We have SP 2013 on premise (will move to SP 2016 / 19 and O365 soon but need to support 2013 for current customers. We want to place a REACT app (javascript code) in a Content Editor or Script Editor ...
1
vote
2answers
36 views

Call function when press ENTER [closed]

I've this code below: <div class="search-container"> <input id="search-value" type="text" autocomplete="off" ng-model="vm.searchQuery" ng-focus="vm.searchBoxHasFocus = true" ng-blur="vm....
4
votes
1answer
143 views

upper/lower case naming convention for Document name in SPO Doc Lib

I have a situation where users have uploaded several files but without any naming convention. So some of the file names are in upper case while some are in lower case . So Now I have to build a script ...
2
votes
1answer
22 views

Display none in table row

How can I do a display none in div with id="NoveMeses" if all elements from h3 show "N.A"? If h3 from div row1 and row2 show me the span="N.A", I want to display none the div NoveMeses. There is my ...
1
vote
0answers
18 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
3answers
54 views

Redirect SharePoint sub-sites from Old to new URL

We are migrating from SP 2013 to SP 2016. There are multiple sub-sites under the main site and further sub-sites under those sub-sites. The users may have bookmarked specific libraries and lists from ...
0
votes
1answer
18 views

get termset description sharepointOnline

how to get termset description using javascript. i get the term object but with not information about the description : getTerm: function (termName,termId) { var ctx = SP.ClientContext....
0
votes
1answer
32 views

Show list of file names uploaded across the site collection

I have a requirement to show List of Document names uploaded in all the libraries across the site collection, sorted by Created Date in descending order. I am working with SharePoint online and this ...
2
votes
2answers
40 views

Where is the documentation for javascript for the pnp libraries?

I am trying to build a SharePoint Add-In and I am struggling because all documentation seems to be in TypeScript. I am sure TS is great but I don't have time to learn it right now. Does MSFT not have ...
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 ...
0
votes
2answers
30 views

Why the AJAX function is only executed in the end?

I've this code below: jQuery(document).ready(function() { jQuery.ajax({ url: "https://test.sharepoint.com/sites/test/Negocio/OfertaParticulares/_api/web/folders('Dinamico')/...
0
votes
1answer
44 views

Displaying List Item in CEWP on another Page

I have a SharePoint with several calendars named for their store number, I also have a list named Store Addresses which has the store numbers and their addresses. I am trying to display the address ...
0
votes
2answers
29 views

Data from Sharepoint REST API is returning undefined

I've this code below: jQuery(document).ready(function() { jQuery.ajax({ url: "https://test.sharepoint.com/sites/test/Negocio/_api/web/folders('Historico')/folders?$...
0
votes
2answers
72 views

JS script only throws error when used in SharePoint in Internet Explorer 11

I'm experiencing this strange issue. I have a basic valid javascript app (Vue.js + Vuetify framework) which works fine in any browser (without SharePoint, so run from any hosted environment). Next I ...
2
votes
4answers
87 views

How do I change link/url for text “SharePoint” in the top bar

I am working with SPOnline and trying to see if there is a way to change link/url when users click on SharePoint in top bar. See below screenshot. I believe it has to be done at master page level, ...
1
vote
1answer
32 views

Show the SubFolders in DIV using Sharepoint REST API

I have this code bellow: jQuery.ajax({ url: "https://test.sharepoint.com/sites/test/Negocio/_api/web/Folders('Historico')/Folders", method: "GET", ...
0
votes
0answers
10 views

Optimize Retrieval of Multiple Lists

The below code snipped retrieves all items within each list in a subsite. Then filters by list title so that only information from lists containing "RDTEN" or "procurement" in their title get parsed. ...
0
votes
1answer
45 views

Why is my loop not iterating?

I have a blog list (SP2016) which I am using to display news items. On the blog list I have a workflow which sets the Created by(Author) field to system account. for a better ux I am capturing the ...
0
votes
1answer
21 views

Call JavaScript dynamically on Visual Web Part

I currently have a visual web part that displays clocks from different time zones, using the jClocksGMT library as provided here in the .ascx file. However, instead of hardcoding the timezones I want ...