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
2answers
27 views

Sharepoint Pre Save Lookup Validation

I'm new to SharePoint, so will appreciate any help here. I'm trying to run two checks before a user can submit a form, be it on a new or edit form. The first check is the value of a field is >0 and ...
0
votes
1answer
26 views

Hello User, Userid is not defined

I am using below code. I am getting an error: Userid is not defined. <script type="text/javascript"> var loginName = ""; var userid = _spPageContextInfo.userId; GetCurrentUser(); function ...
1
vote
2answers
26 views

Is it possible to disable weekends from Sharpeoint Datepicker field

Is there an option to disable the weekends in default Sharepoint Datepicker field, I was able to disable the past days with the help of the below URL: How to disable previous date in a calendar in ...
1
vote
1answer
1k views

disable people picker 2010

I am using following "code" to disable people picker in custom edit form: $("div[id$='_UserField_upLevelDiv']").attr("contentEditable",false);//Disabling People picker $("span[id$='_UserField']")....
0
votes
0answers
14 views

I've an endpoint from which I should fetch the data in SharePoint 2013

I have an API key and an endpoint like : mysite/mysite.sharepoint_service.num_grants?x_key=key&x_lookup=abcde&x_ts=55888 Here: x_key: md5 hash of a secret api_key x_lookup:base64 encoded ...
0
votes
3answers
681 views

How to load multiple item

I'm using SharePoint 2010. I'm trying to load mutliple selected item from a view in a ribbon on a custom list. I can have the selecteditems but when i try to display a value for an item, i've an ...
0
votes
1answer
18 views

Change one SharePoint site link in the Global Navigation redirect to another site for all users except one

For example, a site in the global navigation, when clicked should redirect to another site for all users except one. Also, users who have saved the site as bookmarks should be redirected too when they ...
0
votes
2answers
18 views

SharePoint 2016 Search Error - Display Error: The display template had an error

In my SharePoint 2016 On -premises site, search is not working and giving the following error: In my analysis i've found that Group_default.js file is not loading while searching, however when i ...
5
votes
2answers
967 views

REST API ItemCount on oData BCS List

I have a list generated from a BCS oData provider and I am attempting to get the number of items in the list so I can generate a $top on my request rather than bring back only the 100 item generic ...
7
votes
1answer
4k views

How to authenticate user in SharePoint Online using rest api

I have a website on SharePoint Online and a website on SharePoint On-premise. From my On-premise website i want to create a new list on my SharePoint Online site. To authenticate I used the following ...
3
votes
1answer
5k views

Uncaught TypeError: Cannot read property 'toString' of undefined

I have implemented the jQuery UI autocomplete functionality on a input field using JSLink. It works like a charm when I test it using Internet Explorer 9, 10, 11 and Chrome. Some users are however ...
0
votes
1answer
1k views

Add a “add Link” to a Content Editor Web part

I have used a Content Editor web part to display a scroll-down list of links. The code I use is similar to this: <select id="mySelect" jquery110205452414735412181="1" ...
1
vote
1answer
815 views

How to adjust Textbox in New Form Item using JavaScript/JQuery

I'm new with SharePoint 2013 Development and I'm really enjoying it. But I did encounter a bump with creating new forms ins SharePoint Designer. I have a simple custom list and I need to have fields ...
0
votes
0answers
30 views

JavaScript & HTML errors in SharePoint

I'm new to JavaScript and am trying to work through some errors. I've researched sites and made a few changes but still having trouble. Any assistance is appreciated. The goal is to take selected ...
2
votes
1answer
1k views

SharePoint 2010 Javascript JSOM creating a List View Web Part using javascript

I was able to follow along and add a Content Editor web part to a page using javascript from MSDN here. I am now interested in trying to find a way to add a List View or Data View web part to a page ...
0
votes
1answer
21 views

Pagination in SharePoint Rest API

We have to load records into page using REST API and to show 5 records per screen. So we want to have Prev and Next buttons so that user can navigate backward and front as loading of all records at a ...
0
votes
1answer
1k views

how to change Sharepoint 2013 Default Sign-in Page and create Custom Page (normal.aspx) which redirects users to Http handler(test.ashx page)

Sharepoint Default Sign In page should redirect to my Custom HTTP Handler test.ashx code. I configured multiple claim authentication in sharepoint server 2013 and I need to by pass multiple ...
0
votes
2answers
23 views

Modern Sharepoint and Calendar embed?

Any way to embed Modern calendars (like we use to classic) in a Modern pages? I see the events webpart, but not the same? Any way to change what fields are shown in the day box in a month view? We ...
1
vote
2answers
4k views

HTTP 403 Error when using REST to update Lists

I'm having a problems using REST to POST to a SharePoint List named Employees. I can get my code to GET data from the list, but when I try to POST data to the list it does not work. It gives me an ...
0
votes
1answer
3k views

Get data from multiple lists using REST API

My requirement is: To pass listnames as an array to a method and concatenate the result after each success. The problem is I'm not able to concatenate the result from the previous ajax call ...
1
vote
1answer
1k views

Clear multi-value lookup via Jquery SP 2013

I am trying to clear a multi value lookup field using javascript when an item is re-edited. I have tried all the following combinations without success $("input[id^='Test'").removeAttr(); $("input[...
0
votes
1answer
26 views

Can you use REST API to upload photos from your phone onto SharePoint 2013?

I need to develop a mobile web application that allows users to upload photos onto a SharePoint photo library or document library using REST API. For some reason, users can upload photos from their ...
0
votes
1answer
21 views

Get all groups for a user? (by user name)

In javascript, I'm trying to get a list of all the groups to which a user belongs. For the current user I can use SPServices + GetGroupCollectionFromUser. But for other users I would need the login ...
1
vote
1answer
15 views

SharePoint REST API Call returns result as block of array

I have a REST API call in SharePoint and everything is working as expected, however the output returned by call is array of array if more then 100 records are fetched (attached image): I am not sure ...
1
vote
1answer
2k views

Getting regional settings of current user using JSOM or JavaScript

I want to fetch the regional settings of currently logged in user NOT the current web. Reason being, the regional settings and language settings is pushed through user profile service (or user might ...
1
vote
2answers
2k views
0
votes
1answer
18 views

REST API get choice values from column in ascending

We are using this URI: /_api/web/lists/getByTitle('MyListName')/fields/getbytitle('MyColumn') to get the choice values from the column. I need to pull them into an array alphabetically, but the $...
2
votes
5answers
27k views

Schedule a workflow to run everyday

I want a workflow to run each day at 2.00 AM. Is there a way to achieve this? I found many posts but didn't work.
2
votes
4answers
2k views

Sp Services and calendar list

I have a SP Service call which uses GetListItems from a calendar list in SharePoint. I'm using it with the FullCalendar plugin. The events render fine that is not my question, my question is this: Is ...
0
votes
1answer
1k views

Rest API authentication

I need to use the SharePoint Rest API from a custom JavaScript application (outside from SharePoint). How can I authenticate the user to use the Rest API. I can not deploy a SharePoint app, I need ...
2
votes
1answer
2k views

Show persistent status bar + form to update easily

I want to keep informed the end-users of my SharePoint site of any issue or relevant informations. Naturally, I would like to do so by filling HTML elements (input and select tags). Hence displaying a ...
0
votes
1answer
2k views

CSR Error: Cannot read property 'style' of null

Trying to color rows based off of the value of the "Status" column However I cannot get it working as it keeps giving the following errors: TypeError: Cannot read property 'style' of null ...
0
votes
0answers
11 views

Create multi-level hierarchy (Multiple depths) left navigation menu with expand/collapse

I am on SharePoint Online and i am using Wiki pages to manage our content. I have successfully implemented a code to make the menu as expand/collapse, like below: However, i want a solution to ...
0
votes
2answers
32 views

Make SharePoint Online list columns read only based on yes/no checkbox

I have 7 columns that I need to make Read Only (greyed out) as soon as the item is saved when "Field 7" is ticked (yes/no checkbox column). I have managed to make these 7 columns read only using the ...
1
vote
2answers
1k views

Use javascript/jquery to see if items in list are due soon in Sharepoint 2013

I am trying to determine by date if an item is due. In my use case, my user will create an item with a date in the following format (MM/DD or 06/15). Now if the date the user chooses will fall in the ...
3
votes
1answer
2k views

How can I get an image map to highlight various parts with mouse hover?

I am using SharePoint 2010 and I'm trying to use javascript and html to create an image map that highlights different sections of the image depending on where the cursor hovers over. In this case I'm ...
0
votes
0answers
14 views

How to get cookies from SharePoint using cordova js client

I am developing a client using cordova to display news from SharePoint. I get the news, and then I get the CanvasContent1 news with the HTML layout. To work with the API, I use the access token ...
1
vote
2answers
21 views

Unable to save all users into SharePoint list

I am creating a list item using the code below: var context = new SP.ClientContext.get_current(); var dfd = $.Deferred(); var targetList = context.get_web().get_lists().getByTitle(listName); ...
0
votes
1answer
5k views

SPService GetListItems with CAML : can't get the example to work with status giving error

I am new to SPServices and trying start with example GetListItems. Below is my code $(document).ready(function() { GetTasks(); }); function GetTasks() { var method = "GetListItems"; ...
0
votes
0answers
23 views

How to attach files from mobile phone to SharePoint list Item with REST API

I need to upload/attach files from mobile devices to a SharePoint list item. I can upload files from computers but it doesn't work if I do it from my smartphone. Here is my ajax call: $.ajax({ ...
0
votes
2answers
86 views

Need to grab address column and pass it to an array

My script uses an array like this: var locations = [ ['Location 1 Name', 'New York, NY', 'Location 1 URL'], ['Location 2 Name', 'Newark, NJ', 'Location 2 URL'], ['Location 3 Name', '...
23
votes
10answers
86k views

Get Site Collection full URL using javascript

I want to get the URL for my site collection. One way I thought I could do it was using the window.location in javascript and getting it that way. I know that you can use ECMA script and the client ...
0
votes
0answers
8 views

How do I modify this Script Editor (snippet) code to Hide Web Parts based on a Yes/No field in my list, currently only Hides web parts

Field Name is "Active" which is a Yes/No checkbox field List Name is "Award Cycle" SNIPPET Code: <script type="text/javascript"> function hidepart() { var hideWP = document.getElementById(...
1
vote
3answers
1k views

Add javascript in master page sharepoint 2013 using wsp solution file

I added user control and then empty module to reference user control inside SharePoint 2013 master page but it is not working. Control Id="AdditionalPageHead" Sequence="150" ControlSrc="~/...
0
votes
1answer
2k views

How to Sign-In with Sharepoint from the Javascript?

I used the following code to access the sharepoint from javascript var soapDataString = "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/...
0
votes
1answer
11 views

SP2016: How can I add visit counter for documents?

My SharePoint site has anonymous access and extended for internet. I want to stroe anonymous number of visits for each document (such as Images, Videos, and etc.) and show to all anonymous visitors. ...
0
votes
1answer
15 views

SharePoint Project Management System

Unfortunately I have no code yet but I feel like this is the best place to ask the question to decide which approach to go down next. I want to build a project management system. Currently a user can ...
0
votes
1answer
16 views

Sharepoint 2013 Set Javascript Caml Query output to variable for use in other functions

I am using Javascript to create a CAML Query to get data from a list in Sharepoint 2013. It works perfectly. Instead of pushing it to HTML, I need to push the output to a variable as a string for use ...
0
votes
0answers
25 views

Access Sharepoint files from external site

I am building a Wordpress website for a client who keeps data in an excel spreadsheet on a sharepoint site, updated regularly. The website needs to be able to access this data when a user visits a ...
0
votes
2answers
819 views

Get additional column values from selected item in list view using Javascript\JQuery

I'm currently using JS (items[i].id;) to successfully get the id of selected items in a list view, however, I would like to pull column values from the selected row(s) like "Title" etc. if possible ...

1
2 3 4 5
102