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

Custom Ribbon Button with javascript

Hi i'm working on a sharepoint Addin i wanna create a custom ribbon button using javascript , i tryed with xml it's work fine using this code : <?xml version="1.0" encoding="utf-8"?> <...
1
vote
1answer
22 views

Disable Filter on Individual Column Headers of Custom List

I'm working with SharePoint 2013 and my Company don't allow the use of SharePoint Designer. I have created a custom list and am looking to disable the column header filter from a number of the ...
1
vote
2answers
870 views

How do I hide the FINISH and CANCEL buttons on SharePoint survey?

I am working with SP online. And i have written a custom code "JavaScript". I am primarily looking to hide those Two button's from my SharePoint survey list as mentioned above in the title. Below is ...
0
votes
1answer
643 views

I have to create the pivot table and pivot chart based on the sharepoint list data 2010

I need to create the pivot table and pivot chart based on the sharepoint list data 2010. Please help. Thanks!
0
votes
0answers
17 views

Plain Text validation on presave function sharepoint

I have OOTB list. On new item adding I want to validate, on drop-down selection if value is USA three multi-line text box will show with mandatory field. I know we have to write validation on PreSave ...
1
vote
3answers
34 views

Script Editor web part not allowing me to insert code (or cancel)

Whenever I paste the following code into the script editor, instead of it allowing me to click 'insert', the entire window changes into the output of my script. There is no way to circumnavigate this ...
0
votes
1answer
28 views

PnP js call returns “Item does not exist”

I'm running a small code to upload file in a SharePoint 2016 document library and to change a metadata. Sometimes (but really often) my code returns error "Error making HttpClient request in ...
0
votes
1answer
16 views

Add jquery reference to JSlink file

I am using JSLink feature of SharePoint 2013, My JSLink file has code to get current user id and other details, for this I need to add reference of jQuery file. I tried adding those files in in ...
1
vote
1answer
66 views
+50

Register Custom Action with Javascript

I am having difficulty registering a custom user action through JavaScript. I am using the following code example. The code executes without any error however the button fails to appear on the Ribbon. ...
2
votes
1answer
719 views

Redirect to thank you page after submitting survey

I'm using sharepoint 2013.I created a survey using the survey app. I added a web part script to the survey. I tried to redirect to a thank you page after clicking the finish button on my survey. It ...
0
votes
3answers
41 views

SharePoint online add link to a document library on new list item

starting to use SharePoint online and I am loving it so far. However I need some guidance (if anyone can guide me by giving me material where to look at). Basically I want to modify the ItemAdded ...
1
vote
1answer
722 views

getItemByID is not a function

I have the following script that is returning the error message "list.getItemByID is not a function" and I can't figure out why. All examples use this function. I am trying to iterate through ...
0
votes
2answers
718 views

Disable Edit WebPart and/or Snippet link in a Script Editor Web Part on SharePoint Page?

I know it can be done with client side coding, but maybe there is a built in way to do this in SharePoint 2013. I have a web part I share with other sites, but do not want site administrators seeing ...
0
votes
1answer
732 views

Save Modal Dialog Field Value to Refresh Page DIV

I found a couple great functions that allow me to programmatically call up a modal edit form, and they work very well. What I'm looking for is a way to update a div on the calling page with the ...
1
vote
1answer
32 views

Color Coding List Item by Web Part based on value

I am currently trying to get color coding on a list to highlight good medium and bad properties. I have tried to follow the examples shown here for color coding: SharePoint 2013 Client Side Rendering:...
0
votes
1answer
730 views

REST addViewField “Cannot handle the data at position 0.”

I'm currently writing an initialisation script for a SharePoint-hosted application which checks if a list (used for launcher items) exists. If it doesn't, then it runs through a series of processes to ...
3
votes
4answers
5k views

Adding notification from server side, code ignoring ExecuteOrDelayUntilScriptLoaded

I'm trying to add a UI notification from server side. To do this, I've written this code in one of my code behind event handler: private void AddNotifySuccessScript() { var ...
0
votes
1answer
10 views

Javascript issue in Chrome with AddAnApp.aspx

I have created a piece of code which will check if your on addanapp.aspx page and if so it will read your permissions on a list and if you have EditList perms it shows 'Custom List' app only on add an ...
0
votes
1answer
41 views

expandable list of columns ( sharepoint 2013)

I have a list with too many columns (over 20 columns) and I would like to make some of these columns expandable to make the navigation easy for users. is it possible, knowing that I don't have ...
0
votes
0answers
13 views

Open built-in “Manage Access” dialog from javascript

SharePoint Online has a few nice dialogs such as "Manage Access" for a specific document. If you select "Share" for document you get this dialog: You can select "Manage Access" and get this nice ...
0
votes
1answer
741 views

Populate a Word Template with Dynamic Data From a HTML Form on a Sharepoint Page

I have a SharePoint site. What I want to do is: 1) Upload a Proposal Template and create an HTML form that allows our sales guys to enter customer details 2) Allow the sales guy to select some options ...
0
votes
1answer
38 views

JavaScript in SharePoint Online

I was wondering how i would go about implementing JS into my SharePoint online master page. Is the best way to have a separate file with JS functions that is stored in the site contents and then ...
1
vote
4answers
3k views

Get last modified date of item added/updated in a site - JavaScript

I want to get the date / time stamp for the last item was added / updated to SharePoint site using JavaScript. Is there any API in JS to do so? Thanks.
4
votes
2answers
3k views

What are the advantages of using SP Services?

What advantages would I gain by using the SP Services library in SharePoint releases 2010 and later? The 2013 (and even the 2010) JavaScript Object Model and REST API seem to cover a significant ...
0
votes
2answers
680 views

SharePoint cascading drop down on visual web part using client side code

Hi I am working with cascading drop down in a visual web part. I am able to complete this functionality using c# but I want to implement this functionality using JavaScript jquery basically I want to ...
0
votes
1answer
715 views

Export out data view list to Excel

I have a data view list made using a linked data source of several SP lists. I tried to make it so that the data view list can be exported out as Excel, just like SP list. Is this possible? I tried ...
4
votes
1answer
775 views

401 (Unauthorized) in Google Chrome

When I Get the document list from SharePoint site I get this error "401 (Unauthorized)" only in Google Chrome, but in IE it works. This is my code function GetListItems() { var siteURL = "http://...
1
vote
1answer
782 views

Files move from one library to another library using jsom

Below code is working fine, but inside for-loop if I put alert,then moving multiple file but if I remove, only one file moving. I do not want any alert/pop up. Please suggest. ...
0
votes
0answers
19 views

How to ensure field is unique using JavaScript

I have two lists: List A - a workflow tasks list List B - an employees list containing fields such as employee name (person column), employee number (single line of text), etc. I have a workflow ...
4
votes
1answer
726 views

SharePoint Workflow Subscription Service failed

I have one requirement to start the SP workflow through JavaScript. For this, I have wrote some lines of code to start the workflow. But I am getting a Subscription failed error due to undefined ...
6
votes
6answers
26k views

How to set the people picker field using jquery in sharepoint 2013 to current user

I was able to set the current user to people picker field in SharePoint 2010,but now i am new to SharePoint 2013 . Please tell me how to set the current user value to that filed. In SharePoint 2010- ...
3
votes
1answer
794 views

Filter sharepoint list using multi line text field

I'm trying to filter a sharepoint list using ajax api. So one of the filtered field is Multi line text field (FieldType.Note) , after performing request it throws an error telleing that the field ...
3
votes
2answers
750 views

To ScriptLink or not to ScriptLink

I need a custom ribbon button that calls a function in a js file in one particular library. To get access to the JS file, I could: Add the JS file reference via a content editor web part on the ...
0
votes
1answer
24 views

How to open up View Item from task list in SPO in a new tab

I am working with SPOnline Task list. Users click on View Item for a given task to go to the display form which by default opens in same window. Is there a way to open it up in a separate tab? ...
0
votes
1answer
867 views

How to get Sharepoint 2013 variation URL?

I want to create a toggle button for variations, so that when I am on the en or fr page, and I click the button it takes me to the other page. But I can't just change the en to fr, for example, ...
0
votes
1answer
737 views

Get document from Document Library using Javascript

I am trying to get a document from document library.I am getting the file but I can't get its binary value. $.ajax({ url: fileUrl, binaryStringResponseBody: true, headers: { "...
0
votes
1answer
808 views

Allow a SharePoint document to be displayed in a frame

I have a SharePoint list with attachment, I want to display these attachment in a Frame for preview but I get this error: This content cannot be displayed in a frame To help protect the security of ...
1
vote
1answer
814 views

use SP.UI.Dialog on page load without ExecuteOrDelayUntilScriptLoaded

I know I can do this: ExecuteOrDelayUntilScriptLoaded(function() { SP.UI.ModalDialog.showModalDialog(..) }, "sp.js"); But I want to call SP.UI.ModalDialog.showModalDialog as soon as the page ...
0
votes
2answers
27 views

How to chain promises for multiple ajax calls to SharePoint to get user ids?

Broken promises, thought I had it figured out, still trying to get reliable results. Console log shows hit and miss results. Below is the rundown of what I'm trying to achieve. Is there a simpler way ...
0
votes
1answer
749 views

Concatenating a javascript variable into a camlQuery

I have a caml query that I'm concatenating with a javascript variable of type string. It queries the column names 'Audience' and returns the first 3 ordered by the newest. The variable subsite gets ...
1
vote
1answer
19 views

Opening SP Document library upload Form on a button click using JS/JQ

I am working with SharePoint 2019 on prem. On one of the pages, I have content search web part added which shows documents results from a library as a search solution. On the same page, I am looking ...
0
votes
0answers
30 views

Clickable Hyperlink in the Input Mask SharePoint 2010

for a long time now I have been faced with an unsolvable challenge because I have no knowledge of js. I would like to add a field with a hyperlink to the input mask. This field with the hyperlink ...
0
votes
3answers
1k views

Add OnClick Event to SPFX Html - No Framework

I have an SPFX Web Part (No Framework) and would like to add an onClick event to my which will call my function swap(). Code: export default class ExpandableIFrameWebPart extends ...
1
vote
1answer
794 views

How to get server datetime without postback using JSOM or services

My application page may be long time without reloading, and user changed system date and time. And I need to know datetime from server, not from client.
2
votes
2answers
3k views

Javascript Does Not Work in Internet Explorer

For my list I have created a custom NewForm.aspx and EditForm.aspx that uses a custom stylesheet and javascript/jQuery with spservices. The page works wonderfully in Firefox. But when I open the ...
0
votes
1answer
20 views

JSOM to alert users about not classified files

Due to the fact that I'm not able to use any powerapps, I'm limited to use javascript to achieve this goal. I want to send and alert or email to the user, letting them know that these files have been ...
1
vote
1answer
795 views

how to create publishing page in pages library using ecma or rest in SharePoint 2010

I want to create publishing page in pages library via JSOM (ecma script) or REST api. Is there any way we can create in SharePoint 2010? Please let me know if anyone has any idea? Thanks, Rajeev K
0
votes
1answer
23 views

How to run AJAX call on page load and access that information from a custom webpart? [SharePoint Foundation 2013]

New to SharePoint development and not understanding how things work: I have a "directory search" custom webpart on my home page. It currently only works on the second search. I guess the AJAX call ...
1
vote
1answer
823 views

How to delete a row from an Excel Table using the client-side Ewa object in a SharePoint Excel Web Part

The SharePoint Excel Web Part client side API ,Ewa (https://msdn.microsoft.com/en-us/library/office/ee589018.aspx) does not seem to have any methods to manipulate an Excel Table (i.e. a ListObject in ...
1
vote
2answers
63 views

How to get all properties of a Site Page using REST API?

I am writing an application in AngularJS for a SharePoint 2013 site collection, using the REST API to talk to SharePoint. My task is to update the Image Link in the Title Bar Properties of every Web ...