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)

4
votes
2answers
125 views

How can I validate against all special characters in the attachments file name?

By default SharePoint does not allow the following special characters to be present in attachment file names ~, #, %, & , *, {, }, \, :, <, >, ?, /, |, “ How can I validate that any ...
1
vote
1answer
63 views

Why does the JavaScript in my *.ascx file not display in CDT?

I want to step through some JavaScript in my *.ascx page, which contains, in part: </html> <script type="text/javascript"> . . . $("#saveData").click(function () { alert('you ...
4
votes
1answer
61 views

Display templates written in html alter for loops

In a display template (a filter item template to be precise), I observe a weird behavior with for loops. Let's say my template consists in: <div id="CustomRefinement"> <!--#_ for(var ...
2
votes
1answer
2k views

Get SharePoint list items from another site collection with JSOM

I am using JSOM to get the list contents of a list which is located in another site collection than my app. For example, my app is hosted here: portal.contoso.com/sites/myapp and the list is on top ...
1
vote
2answers
1k views

SharePoint 2013: How to update multi-value lookup field using JavaScript CSOM

I have a Contacts list which has a multi-value lookup field called ContactType. The result of a CAML query will show the following value for ContactType for one of the list items: ...
4
votes
2answers
185 views

unable to write a script to change the logo redirect url

I am working on a web application which contain 2 site collections , with the following URLs:- http//servername http://servername/HR and the second site collection have two subsites , with the ...
0
votes
0answers
48 views

Javascript redirect page on load with XSL value

I am trying to get a display form to auto redirect to another page. Currently I am using location.replace() which works fine except that each item redirects to another item in a second list. The ID ...
0
votes
0answers
22 views

Refreshing the contents of a lookup drop-down

I have one list (let's call it "Services") that references another (e.g., "Customers"). Frequently, I have employees making a new item in Services, but they forget to add the Customer first. They ...
0
votes
0answers
44 views

Can't add custom javascript and list alert to my custom form

I have created a custom list using Visual Studio in SharePoint app. Then, I have created a custom edit form for it. It is working fine, but when I try to add a new custom javascript file in that ...
0
votes
0answers
60 views

Async webpart - the best approach to access outer data source from webpart

I've already tried to search the web but I always get to some point from which I don't know how to get further. I have a Visual web part which needs to load data from external sources (different ...
2
votes
4answers
109 views

Script syntax and passing issue

I want to call the function startWorkflow() in line 651 and pass two variables. But I don't know how to do that. If I am calling like in the line 649, everything works like a charm. I tried a lot, ...
0
votes
2answers
60 views

Sharepoint 2010 get position of ListItem

I'm working on a custom HTML Form in Sharepoint 2010 and for that I want to read the structure of a list with JavaScript, which contains items and folders. What I did was loading all the Items ...
3
votes
1answer
71 views

JavaScript Errors

I have a single user who is unable to access our SharePoint 2013 intranet site, everyone else can access it without issue. Regardless of the library or level of access granted to the user within ...
2
votes
4answers
190 views

What exactly is the webPermMasks property?

I'm trying to understand what exactly is the "webPermMasks" property inside the "_spPageContextInfo" object, I tried to look in many websites on the web and also in the MSDN. In the MSDN I wasn't ...
1
vote
1answer
135 views

PUT request remote REST service from SharePoint-Hosted App

I'm trying to do a simple update in my MySQL database, I have created a REST service using JPA. The problem is, I don't know where to put the "name/value", the data that I want to use to update the ...
1
vote
2answers
299 views

Get Listitem Attachment URL

I want to get the Attachment URL with via REST or Javascript. Is there an easy way? The reason I need this, is because I want to build a marketplace in my company. User creates new list item User ...
0
votes
1answer
226 views

Non trivial examples of Sharepoint Hosted Apps

A very simple question: there are tons of trivial examples of SP2013 hosted apps online showing how you can get simple things running with just a little bit of JavaScript. One of the most elaborate ...
1
vote
1answer
48 views

REST - How to get the maximum of a number

A list has an int field named AccountNumber. Everytime a new record is created through the NewForm.aspx I need to fill out the field AccountNumber with max (AccountNumber for existing items) + 1. I ...
2
votes
0answers
200 views

Copying attachments using JavaScript (JSOM or REST)

I've been able to copy documents in document libraries using the "CopyTo" method: https://msdn.microsoft.com/en-us/library/office/dn450841.aspx#bk_FileCopyTo I'm not understanding how I can apply ...
2
votes
0answers
186 views

Get all managed properties for search results javascript

I'm following this post on how to do a Keyword Query search in SP 2013. I'm getting the results items that I would expect. Now I need to display info about them. The results are a mix of several ...
0
votes
0answers
55 views

Accessing azure hosted API with sharepoint online add-ins

Here is our situation. We have a sharepoint add-in that needs to obtain data from an api, this api in turn calls a WCF service to obtain the data. Both the api and the WCF service are hosted on ...
0
votes
1answer
107 views

Automatically collect WEBPARTID for rendering CSR (js-link) and paste them into a script JS

I am working on a rendering solution CSR (JS-Link) which uses the webpart ID list view to render. Rendering a JS file is located in a library on the site. The site is then registered model and ...
0
votes
2answers
480 views

Issue trying to do POST Operations using REST, Error 402, 405

I am trying to do POST operations such update, create and delete items using rest and javascript. I am getting 402 Error mostly attributed this to having a wrong/corrupt requestdigest value. When I ...
3
votes
1answer
138 views

SharePoint 2013 - Load JavaScript or CSS file only if not in edit mode

From a custom page layout, for a publishing site collection, how can I tell SharePoint 2013 to display... <script> console.log('this should display in non-edit window'); </script> ...
0
votes
2answers
101 views

Get user properties using JavaScript for use in InfoPath - SP Online

I followed this blog - Pass user information from SharePoint 2013 to InfoPath 2013 It's a really good solution and works well but I want to expand it and get the users department and office location. ...
0
votes
2answers
59 views

Nivo Slider Javascript Object model not displaying

I've been trying to get the Nivo slider to work in SP2013. I want to connect it to a blog in a sub-site. The slider works fine using the raw html sample (without any links to SharePoint lists), but I ...
1
vote
2answers
102 views

SharePoint Online Rest, multilookup

I'm trying to fetch some data from the hostweb from my SharePoint hosted app. This is all going well, however I am having a problem when I try to fetch a multi lookup fields value. Below is my ...
0
votes
2answers
210 views

Set value in a column on click of a button in SharePoint

I have a customized form in SharePoint 2013. I want that on click of the submit button on the list, a value will also update. Currently on click of the submit button, it is saving the values and ...
1
vote
1answer
100 views

Sorting Calendar List Items

So I'm trying to display the next three events on the calendar, but the calendar is sorted by date created, not start date. So I've pulled the list into an array, sorted it there, and displayed the ...
1
vote
2answers
75 views

Can ScriptLink load a remote file?

When I try to load a remote file through ScriptLink it doesn't work. <!--SPM:<SharePoint:ScriptLink ID="ScriptReg2" language="javascript" ...
0
votes
1answer
106 views

Get List Items that contains spaces

I am creating a SharePoint 2013 hosted app and I have come across a problem. I am able to submit everything to my list including a text box that say for instance may contain "this is a test". However ...
0
votes
1answer
27 views

How to add Content Types List on a Page and use it to create NEW document/list based on type selected?

I need to show all content types in a drop-down or as hyperlinks along with description on custom .aspx page. When user selects any type, respective New Form should open to create a new document/list ...
0
votes
2answers
443 views

SharePoint app cross domain call using javascript - object doesn't support property or method ProxyWebRequestExecutorFactory

I'm creating an SharePoint app (add-in?). Now I'd like to get data from a list in my host web using CSOM/JavaScript: var context = new SP.ClientContext(appWebUrl); var factory = new ...
0
votes
1answer
515 views

SharePoint Online Hosted App get List Items from within app

I have a Visual Studio 2013 solution and I have been successfully able to get list items from the host web using the following JavaScript code: var context = SP.ClientContext.get_current(); ...
0
votes
1answer
188 views

Like a list item function

I'm trying to implement the standard like function to a custom view I wrote. My code for getting the items, getting LikesCount and how I display them: <script type="text/javascript"> ...
2
votes
0answers
50 views

SharePoint look up value A (list number value) and hide Add New button if 2nd list count value B (list count) is equal or greater to value A

I have an InfoPath form displaying formation for a commuter sign up list called "Register Commute" I modified the Content Type Display Form and added a list called "Commuter Sign Up" which is ...
0
votes
1answer
96 views

How to have a list auto update once a week and then email the people in the list?

There is a meeting that occurs every week, but has a rotating list of members. So one person from each department goes one week, and the next week it is a different person from each department, and so ...
0
votes
1answer
118 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
0answers
65 views

Microsoft Sharepoint SPException error when using Email API

I am trying to use the SharePoint 2013 Email API and receiving a Microsoft SharePoint SPException code: -2130575251 The security validation for this page is invalid and might be corrupted... ...
0
votes
1answer
172 views

Sharepoint GetUserProfilePropertyFor not returning any results

I am trying to get the SharePoint 2013 API for GetUserProfileProperty, when I put the below url into a browser it works finr, however when i run the below code, I get no result (I do get a return, but ...
4
votes
2answers
481 views

REST API to fetch List/LIbrary URL's from subsites

I am working on a requirement to display all sub sites and list/Libraries inside sub site using REST. I am able to fetch Sub sites and List/Libraries but i am not able to fetch List/Library Url's. Can ...
0
votes
1answer
68 views

SP2010 - CEWP not executing javascript until page refresh

The CEWP is loading a HTML page stored in the Site Assets library. The HTML contains a few inputs and some Javascript. Javascript is: Function myInit(){ console.log("here"); Ctx = new ...
0
votes
0answers
91 views

SP2013 - open URL link in new tab

already for a long time a´m looking for how to edit script below (from http://www.sharepointdiary.com/2011/02/sharepoint-link-list-open-in-new-window_21.html) or how to do it another way. The script ...
0
votes
0answers
39 views

Problems with Query Sting URL Filter when adding/editing Views

I have a page (A) containing multiple links with different query string URL's that are all directed to another page (B), where a query string filter web part takes the selected link's URL and passes ...
0
votes
2answers
218 views

JSOM Script Returning serverRelativeUrlOrFullUrl Error from SP.ClientContext.get_current()

I'm attempting to build a script for a Sharepoint 2013 project management hub that eases the process of spinning up and archiving project subsites as they are needed. I'm having trouble getting my ...
0
votes
0answers
115 views

Javascript Conflict on Visual Webpart when adding multiple times with different webpart properties on single page

What I am doing: I am retrieving list items from list using javascript as per visual webpart custom property. I have created a dropdown in webpart editor part from where I am getting site url. As per ...
1
vote
1answer
809 views

get list items in sharePoint 2013 for google charts api

I'm trying to use Google Chart API in SharePoint 2013. My list name is Utilization and I want to retrieve columns Title and Portal for making the 3D pie chart. Here is my code : <script ...
2
votes
2answers
152 views

Pop-up window to confirm

Where should i fit in a pop-up, using this existing piece of code? <td> <input type="button" value="Save" name="btnFormAction" onclick="javascript: ...
0
votes
1answer
79 views

o365 SharePoint Online .. Write to List on another site with Tenant (all sites) NAPA app? Forbidden Error

Is it possible to write to a list on another site from NAPA developed App on o365 SharePoint Online. I have a simple app that can write to lists on the host web by fully qualifying the list, but i ...
1
vote
1answer
292 views

Use REST API to get the current site collection

I have a list for links in my footer that I'm using REST to populate. $.ajax({ url: "/_api/web/lists/GetByTitle('FooterLinks')/items", type: "GET", headers: { "accept": ...