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.

learn more… | top users | synonyms (2)

1
vote
2answers
60 views

Fetch value of people picker column using javascript - SP2010

I'm using a function to grab the id from the url of the record and fetching numerous field values successfully. It seems to work fine for all fields except for people pickers. When I display the ...
7
votes
2answers
81 views

Basic batched get requests using REST API

I'm hunting around on the web right now for some basic (preferably working) examples of making a batch of get requests using the new $batch endpoint in O365 with the REST API. I've located some good ...
4
votes
1answer
33 views

Can we unlock a ShortTerm lock via CSOM for SP2013

We are using SP2013 with OWA installed. Users often complain about a file stored in SharePiont being locked by another user not in office. Error is "The file "xxxx" is locked for exclusive use by ...
2
votes
0answers
38 views

Starting List Item Workflow using Javascript on custom edit page

I have a custom edit page with some Javascript inserted using a CEWP. From this page I am calling a function to start a list item workflow on the current item being edited. I am using the following ...
4
votes
1answer
79 views

REST API compare current user if exist in a custom list

I have a custom list with 37 user fields, I need to check if the current user is in one of those fields to display an alert. I'm getting the current user with this url: /_api/web/currentUser And ...
7
votes
5answers
128 views

URL redirect from a button

I have added a button into my SharePoint list using SharePoint designer. I want to be able to open a document from the button. So I go the url for the word document by going properties on the normal ...
2
votes
0answers
25 views

how to show less a text [closed]

I have created a function which duty is to Show more text. But i cannot create a Show less to show less my text i have the following html <div class="item"> Ronaldinho joined Barcelona in ...
1
vote
1answer
240 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 ...
1
vote
2answers
53 views

Disable Term Store Input Fields

I would like to disable input fields for managed metadata from the term store in a new item or edit item form on a custom list. How could I do this with javascript and jquery? Should work in Chrome ...
3
votes
1answer
82 views

REST call to get list not working

I would like to make a function to pass a list name, if it exists, then append random number to its name and create a new one, if there's no list with the passed list name, then create it. So I am ...
0
votes
0answers
22 views

Logout inactivity javascript file not working [duplicate]

I 've done the following steps, however, my .js file doesn't do anything. 1- I created inactive.js file : 2- added .js file to seattle.master file in sharepoint designer 3- added inactive.js to ...
2
votes
2answers
41 views

SharePoint 2013 - ScrollTop not working properly on second click

This is the weirdest thing. I have the following javascript code, which causes my page to scroll to a specific location on click... $('.whyattend').on('click', function (e) { e.preventDefault(); ...
2
votes
1answer
26 views

Referencing sp.js in html page gives error

I have referenced sp.js in html page in my sp hosted add-in, in order to use client object model in javascript. But it's giving me an error on _spPageContextInfo while it's referencing the sp.js, why ...
2
votes
2answers
74 views

Basic add list item with JavaScript problem

I am trying to create a list item with JavaScript, but have been having problems. To try to simplify things, I created a simple list called "Test List" with one column, "Title" and created a script ...
3
votes
1answer
60 views

Where should I add Javascript in seattle.master page?

How Do I add this Javascript code to seattle.master page in SharePoint Designer for log off inactive user? function LogOutInactive() { var idleInterval = setInterval(timerIncrement, 60000); ...
3
votes
2answers
56 views

Reference SP scripts in html page in app

I am trying to make an html page in an app, and I want to be able to get: SP.Utilities and _spPageContextInfo, which scripts do I need to add to my html in order to make it work? I am in Office 365. ...
-1
votes
1answer
28 views

Redirecting a Form to it's Original Position in Sharepoint Library [duplicate]

I have a Sharepoint Library which has Thousands of Forms. If i submit a form the pointer should point out that particular form which i have closed.
0
votes
2answers
59 views

Hide a list in VS

How can I hide a Custom List programmatically (created the list also programmatically) and create it inside my Visual Studio Ultimate 2013 so that not all users can tamper it? I tried creating a list ...
0
votes
1answer
31 views

c#: how to write JavaScript function inside c# [closed]

How to add JavaScript function window.print()in C# code. C# snippet : private void CTRL3_5_Clicked(object sender, ClickedEventArgs e) { //JavaScript function here! }
0
votes
0answers
36 views

Inactivity logout javascript file not working on sharepoint server [duplicate]

I 've done the following steps, however, my .js file doesn't do anything. 1- I created inactive.js file : 2- added .js file to seattle.master file in sharepoint designer 3- added inactive.js to ...
0
votes
2answers
41 views

Check if a user is signed in using Javascript

How can I do this? I don't care about their permission level, only if they are signed in or not.
3
votes
1answer
37 views

SP2013 - Failed to call, back to back executeQueryAsync() functions

This is exactly what I want to accomplish, given below are the steps I'm performing. Update sub task status based on subTaskId (SP Task List), using executeQueryAsync() Get all sub tasks based on ...
0
votes
1answer
23 views

onQuerySucceeded always trigger

I have standard js code for update a list on Sharepoint. The problem is that the success function is always triggered even if the update is acctualy failed. The fail function is also triggered but in ...
0
votes
0answers
21 views

REST Async responseText different to Sync

When I send a request to http://Sharepoint/_vti_bin/ListData.svc/ListName using a Synchronous request as below the response comes back as a feed with "m:properties" present and easy to extract. This ...
2
votes
1answer
34 views

How to make a print button in infopath form?

In infoPath form I have a button which duty is to print the current document, I have been trying this one thisXdocument.PrintOut(); but the following error occurs "The name "thisXdocument" does not ...
1
vote
1answer
43 views

How to encode a list name for REST in sharepoint 2013 [duplicate]

I created a list in the en site called hello's~`!@#$%^&*(){}[]:;"'<>?/\|*-+. What I am trying to do is figure out what exactly is the encoded version of the name if I am trying to target ...
0
votes
0answers
29 views

What should I do to not disappear the list which I create by this code?

function createList() { listCreation = new SP.ListCreationInformation(); (listCreation.set_title("Countries")) //list title ...
0
votes
1answer
20 views

Apply a filter from a Date Filter web part that was set with JS/JQuery

I have a Date Filter web part that is connected to a list. I can set the content of the filter with jQuery, but how can I get the filter to apply itself when I set the value this way? Normally you ...
0
votes
0answers
22 views

SP2013 on-prem how to check if search service is working?

We have an onsite 2013. Our team doesn't have access to central admin. We are using cross-site publishing and a lot of display templates -- as well as some ajax and spservices to query the search ...
0
votes
0answers
8 views

How to getSelectedItems of a list when user has Read permissions

I have a List where users select items from the List. I want to know which items were selected using JS. Here's a snippet: var selectedItems; var listId; var context = ...
0
votes
1answer
31 views

Best way to encode list names in sharepoint 2013 rest url's?

In SharePoint 2013 rest url's, some of them includes a list name which is passed by a user (in the web part settings) which I then use in a web part. I then stick the list name in a rest url, but now ...
0
votes
3answers
66 views

Issues with Minimal Download Strategy and _spBodyOnLoadFunctionNames.push

I noticed that on the sites that have MDS activated, functions that I queue up with _spBodyOnLoadFunctionNames.push do not get executed. I can step through my code and I see ...
1
vote
2answers
84 views

Error on toISOSTring() object doesn't support property or method 'toISOString'

I have tried almost everything I found on this forum but issue is not resolved. Code is working fine on Chrome but not in IE 11 (windows 7) which is used by everyone in company who will use my ...
1
vote
1answer
23 views

Add user to group error - Code

I am getting an error when trying to add a user to group in JavaScript, here is my code below: user = web.ensureUser("domain\\natalie"); membersGroup = web.get_siteGroups().getByName("site ...
0
votes
0answers
21 views

Script to link image and YouTube video

I know how to link a YouTube video to a graphic image to play the video on a separate page, but how can I get the video to play on the same web part/page when clicked on the image in 2007?
3
votes
3answers
109 views

Query multiple lists using javascript/CSOM

I'm about to query multiple lists using JavaScript (JSOM, SharePoint 2010). It's working when querying one list in a time, but that's annoying when I'm having lots of lists. Working example: ...
0
votes
1answer
36 views

Download attachments as .zip file

I need to develop a C# custom webpart which allow users to download attachments from a sharepoint list. My webpart lists the attachments which the user has selected. Then, it must show him a link to ...
0
votes
1answer
57 views

Prepopulate managed metadata field in NewForm

I am trying to prepopulate a managed metadata field in a NewForm of my list. I don't want to save the value as it will be used as a suggestion passed in through URL a parameter that the end user is ...
3
votes
1answer
42 views

Differing ways to make executeQueryAsync calls (Function.createDelegate)

I want some understanding on two programming patterns I've seen and when to employ them. The question is about callbacks and delegate. In the first code there are two distinct functions, success ...
4
votes
2answers
171 views

Create SharePoint List programmatically

I want to create a SharePoint list programmatically from a SP addin. I would like to know which approach is better: Using JavaScript or Using REST Thanks In Advance
1
vote
1answer
33 views

Problem with adding new item to the list depending on the structure

I've following issue. Function which supopse to create new item on the list, adds the row only when the list is situated in the root node (webUrl = "http://rootserver.com/";) whereas when it is placed ...
1
vote
1answer
77 views

Uncaught TypeError: Cannot read property 'Selection' of undefined

I have a button that runs a JS function (in a Script Editor Web Part): function flexRegistration() { var context = SP.ClientContext.get_current(); var listId = ...
0
votes
1answer
124 views

Get user profile picture URL using ID CSOM

I am trying to get the user profile picture url for a user using some JavaScript, I am querying a person and group field in a list and getting the use id via some CAML Query. However the issue I am ...
3
votes
4answers
153 views

Get item count of a list without getting all properties

I want to get the item count of a list, so my code looks like this: var list = context.get_web().get_lists().getByTitle("tasks"); context.load(list); Doesn't this way retrieve all properties for ...
4
votes
1answer
190 views

How to show and hide a paragraph in html when a button is clicked?

I have the following query. I have a <pre> tag and it has some text inside but i want to hide <pre> when a button is clicked. Following images shows code: When this addNewTest() ...
2
votes
1answer
41 views

Uncaught Error: Incorrect usage of exception handling scope

I am trying to implement try/catch scope in my JSOM, but I am getting the error message in the question's title. Below is my code: errScope = new SP.ExceptionHandlingScope(context); ...
6
votes
2answers
101 views

SharePoint Online - direct from one page to another

I want to be able to go from one page to another in sharepoint, and get the value of the previous page that the user came from. I investigated the method called: SP.Utilities.HttpUtility.navigateTo, ...
4
votes
1answer
69 views

Get ctx.ListData inside Calendars

I want to retrieve some data about each item in a Calendar, but I can't find ctx.ListData inside Calendar view. Is this a bug in SharePoint?
1
vote
2answers
43 views

How to focus field when opening modal dialog

If I have a modal dialog which looks like the following, how can I focus the textarea after opening the dialog? By simply adding $('#txtArea').focus(); after the code, the txtArea has focus for only ...
3
votes
1answer
139 views

How to disable fields in list newform.aspx/editform.aspx using javascript/Jquery

Need to disable Managed metadata field (the below code disables the textbox of the field but not the button which is used to select the value to the field), Choice field with radio buttons or ...