An open-source, cross-platform JavaScript library, now endorsed by Microsoft

learn more… | top users | synonyms

5
votes
6answers
9k views

Set default value in people picker javascript/jquery

I want to set current logged in user to people picker by javascript. I can retrieve the value of user(lets say in var user).But how to set it to people control. Any help is much appreciated.
12
votes
3answers
27k views

Adding jQuery to master page

I am trying to customize a Sharepoint 2013 team site. I created a copy of seattle.master and set it as default master page via context menu. I added my custom CSS within head tages like so: <...
2
votes
1answer
9k views

jQuery & SP2010 : Upload document to library using jQuery?

I built a custom form that saves the data to multiple lists with on click; it works pretty well for its intended use (keeping the data related). Thing is I am totally new at jQuery and SPServices, but ...
10
votes
4answers
23k views

REST API filter by start and end dates using 'today'

I'm new to filtering dates with REST in SP but am trying to do something like below but am not sure how to get today's date in as a variable into the request. I don't think I'm too far off so any help ...
7
votes
7answers
7k views

What is the proper way to add jQuery to a MasterPage?

Currently I am using this method in the header: <script src="/_layouts/MNCAssets/scripts/jquery-1.5.1.min.js"></script> But for some reason, my webparts that use jQuery don't appear to ...
2
votes
2answers
7k views

Dropdown lookup column in Sharepoint list form (newform.aspx)

I have a dropdown lookup field in newform.aspx form. Unlike choice dropdown the lookup dropdown is input field and not select So I raise an onchange event using jWuery $(document).ready(function() { ...
3
votes
2answers
699 views

Select All check-boxes in choice field on document library form using jquery

I have a document library form on which there are two multiple choice fields as shown in below image. Now when user select the option "Select All" in "Vertical" field all check-boxes in "Vertical" ...
2
votes
4answers
1k views

Displaying list with only unique values in title column

I have a requirement, an item should be added to a list, in the list web-part it should only display the title field value with unique values. In the list as shown above, it should display ...
0
votes
1answer
2k views

Unable to reference jQuery inside my master page

I am working with SharePoint server 2013, and inside my Style Library folder I have added the Jquery file. then under the custmJSUrl section inside my seatle.master page, I added a reference to the ...
5
votes
3answers
1k views

Adding a “next” Button to displayform.aspx

Is there a way of adding a button in the Dispform.aspx or the editform.aspx that will take you to the next item in the list?
3
votes
1answer
14k views

Where to put javascript files, problem with _layouts

I'd like to add jQuery and SPServices. I added the following code: <SharePoint:ScriptLink runat="server" Name="/Style%20Library/Scripts/jquery-1.7.2.min.js" Localizable="false"></SharePoint:...
11
votes
6answers
10k views

Risk of conflict between jQuery document ready and _spBodyOnLoadFunctionNames?

I recently read in the jQuery documentation that: The .ready() method is generally incompatible with the body onload attribute. If load must be used, either do not use .ready() or use jQuery's ...
4
votes
3answers
7k views

How to get ClientPeoplePicker value using javascript

can anyone please tell me, How to get ClientPeoplePicker value using javascript.?
2
votes
2answers
5k views

Scroll position in Sharepoint 2010?

Do you know a way to find out a scroll position in JS or jQuery on a page in Sharepoint 2010? I have a web part that is very big (high) so scroll on the page appears. But I cannot determine the scroll ...
7
votes
4answers
3k views

How to access a Web application/Farm level property bag via jQuery/Javascript/ClientContext

It it possible to access the Web application/Farm level property bag using jQuery/Javscript/ClientContext? If not, then what are the possible alternatives to access Web Application Farm level property ...
3
votes
4answers
751 views

Javacript only executed on first page load

I have javascript code included in my sharepoint site. When I load the page the first time, it is executed, but when I load it the second time, it is not running. It get's loaded in correct order but ...
1
vote
2answers
318 views

Is mQuery stable to use instead of using jquery in Sharepoint 2013 and higher?

In my SP2013 environment, I use jquery, but had the issue of the $ clashing with Sharepoint's own $. The original thread was here Does Sharepoint 2013 really have a jquery conflict with $? In there, ...
2
votes
1answer
830 views

js link group count list SharePoint 2013

(function () { var itemCtx = {}; itemCtx.Templates = {}; itemCtx.Templates.Group = GroupOverride; SPClientTemplates.TemplateManager.RegisterTemplateOverrides(itemCtx); })(); function ...
1
vote
2answers
17k views

How to add jQuery script to a custom visual webpart?

Similar to some previous questions, I'm trying to use jQuery in a visual web part but I keep getting that jQuery is undefined. I've added the jQuery script to SiteAssets as well as a script folder ...
1
vote
2answers
5k views

Retrieving a lookup Value from a List using jquery and REST

I would like to get the lookup Value from a List item depending on it's Title. My List is set up similar to the following example: ColumnA : a | b | c lookupB : 1 | 1 | 2 The jquery: function ...
3
votes
1answer
84 views

Create custom list in sharepoint 2007 using JQuery

I need to create a custom list in Sharepoint 2007 using JQuery (only!). I'm using Sharepoint 2007. Is there any way to do it?
2
votes
4answers
4k views

How to get the Login Name of user from people picker control using jquery?

I want to get the log-in name of user from people picker control using jquery. I have a code which displays the display name of the user but I am not able to get the login name. Code is as follows: ...
0
votes
2answers
3k views

how to add script to page

I am trying to add this script (Marc Anderson's blog) to AllItems.aspx. Please guide me where it needs to go and what needs to be done to make it work. Thank you. <script language="javascript" ...
0
votes
2answers
534 views

Check an user belongs to a AD group inside SharePoint Group using SPServices JQuery

I want to check the current user exisit in a AD group inside the SharePoint Group using SPServices JQuery. I used the below code snippet but not successed. Any suggestions? $().SPServices({ ...
7
votes
1answer
4k views

Fetch list of sites in site collection into jQuery

Is there a way to get the list of sites in the current site collection into jQuery as an array or other data structure? Thanks.
3
votes
4answers
1k views

How to make Grouped View work with the $(document).ready event?

I have a list that is grouped by date: Normally the list is collapsed, when I open one date, items under it are shown, like: [+] 2010-01-01 [+] 2010-01-02 [-] 2010-01-03 item1 item2 ... I ...
8
votes
3answers
4k views

Add Ribbon Button via JavaScript

I have specific requirements from my client that he wants to add some additional Ribbon Button "but only" via JavaScript (including EnableScript reading value from some other list). They don't want to ...
2
votes
3answers
4k views

How to Create Piechart in sharepoint 2010 Based on the List item Values? Only using Javascript/jquery

I have a CustomList in Sharepoint 2010 as Mentioned Below.have two columns Team and Values of Team List A Team ValuesofTeam A 9 A 6 B 7 C ...
2
votes
2answers
3k views

Get List Item ID from NewForm.aspx

SharePoint 2010 Enterprise Version I have a Custom List and i have created a copy of NewForm.aspx and saved it as CustomNewForm.aspx. When I save the item i want to get the saved items ID and ...
1
vote
1answer
5k views

Using REST call to retrieve SharePoint list items as an array of JSON objects

I found this great tutorial to use REST calls to retrieve SharePoint list items as an array of JSON objects posted by Mark.Rackley (Mark Rackley.). It is working, but I would like to add a new ...
1
vote
1answer
151 views

Using SPServices' GetListItems to sort by what the current user has “liked”

I'm using getlistitems to grab list data in SharePoint 2013, and I've managed to be able to filter by the current user's "liked" list items... but is there a way to sort by what a user has liked and ...
1
vote
3answers
727 views

Can't get People Picker value on 'Edit' form load

When opening a SharePoint EDIT form, I'm trying to capture a people picker value using JavaScript. Unfortunately, the people picker isn't loaded with data when I call .GetAllUserInfo. I'm using the ...
0
votes
2answers
171 views

Should we consolidate all form customization javascript into one file?

On the project I am working on (SP2013 on-premise), almost all the form pages (Newform.aspx, DispForm.aspx and Editform.aspx) have added a Script editor webpart with JQuery to customize form layout (e....
10
votes
3answers
5k views

Site Assets vs. Style Library

I usually store my JavaScript/jQuery files in the Site Assets library, but I see on forums that others are using the Style Library. What are the respective benefits of each?
4
votes
2answers
4k views

SharePoint Online REST API - Get List selecting all fields excluding one

The below will get a list containing all fields $.ajax({ url: "http://<site url>/_api/web/lists/GetByTitle('ListTitle')/items?$select=*" ,type: "GET", dataType: "json", headers: ...
4
votes
1answer
680 views

CSOM Search API does not return all the results

I am having a problem with the code below. It is not returning all the rows/items which are found in different lists. The total number of items is 28, but the code below is returning 19. I have set ...
3
votes
2answers
344 views

Does Sharepoint 2013 really have a jquery conflict with $?

I have been working on SharePoint 2013 recently, and noticed that under variation sites, SharePoint 2013 has a java script file that defines a global variable called $ which overwrites the jquery $ ...
3
votes
6answers
7k views

How to update multiple ListItems with a “Where Clause” using SPServices?

I've searched the jQuery SPServices code examples and MSDN references for an simple example how to update several ListItems using a Where-Clause. Code for updating a single ListItem with ID = 500, ...
3
votes
4answers
2k views

SharePoint 2013 / bootstrap.js / only working in edit mode

I am trying to get the twitter bootstrap framework running on our SharePoint 2013 intranet page. When I'm editing the page, the code is working as expected. After saving the web part page, the ...
3
votes
4answers
8k views

Loading jQuery in the Correct order

I wish to use a jQuery plugin in SharePoint. Currentley I have jQuery added to each page via a custom master page. <script src="/Style Library/js/jquery-1.6.4.min.js" type="text/javascript"><...
3
votes
2answers
5k views

Path to jQuery file for SharePointWebControls:ScriptLink

I'm working in SharePoint 2010 Designer to create a custom page layout. I've added a SharePointWebControls:ScriptLink control but am not sure what the path is to my jQuery library. It's uploaded to ...
2
votes
2answers
735 views

Get Modal Dialog Close button

I have override new item form for list, opening myPage.aspx where this javascript is in the "PlaceHolderAdditionalPageHead": function fGetCloseBtn() { var closeButton = jQuery("a[id^='DlgClose']")...
2
votes
1answer
454 views

How to use aop.js with jQuery on Grouped Lists?

This question came from following up on an answer given here. I want to use jQuery to work css modifications on a list that has grouping. I discovered a jQuery script called aop.js that will allow ...
2
votes
2answers
1k views

How can I ScrollTop in SharePoint 2010 with JQuery

I try to scroll the SharePoint page after the page loaded. Using the following code: $(document).ready(function(){ $('html, body').animate({scrollTop: $('#WebPartWPQ1').offset().top}, 1000); }); ...
2
votes
1answer
1k views

Jquery is not working on IE10

The below script works properly on the firefox and hides the Page Rating & Last modified divs however it is not working on IE-10, am I missing anything? <script type="text/javascript" src="../...
2
votes
3answers
4k views

jquery and javascript : can i get the last ID from document library?

Is there a way to get the last ID from a Document Library with javascript/jquery?
2
votes
3answers
3k views

How can I generate new ID for new list item (NewForm.aspx)?

I wanted to add a new ID on NewForm.aspx unfortunately that can't be done because a new ID has not actually generated yet. However, I thought maybe there is a way, by getting the current list's last ...
1
vote
2answers
15k views

Setting the value of a lookupfield(sharepoint dropdown formfield) in sharepoint 2010 list forms

How can i set the value of sharepoint form field dropdown box(lookupfield) in sharepoint list form when the form gets saved (using jquery) note: the lookupfield (dropdown formfield renders as input if ...
1
vote
2answers
235 views

Can't get jquery to work

I can get this block of jquery to work on basic HTML in Codepen However, it doesn't seem to be working when I try this on a SharePoint 2013 Publishing site. I embedded the CSS and JQ in my master ...
1
vote
1answer
357 views

Disable drag and drop option for multiple file uploader

These are the screenshots of multiple file uploader from the same SharePoint 2010 site. Some users are seeing the first and some are seeing the second one. Is it possible to disable the second view(...