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
3answers
2k views

How to get current search query in a search page

In a SharePoint 2013 publishing site, I have a custom search page. This page can be reach from the search box in the master page. It lands on : http://server/pages/search.aspx?k=myquery, which is ...
1
vote
2answers
410 views

EventListener for List changes in Sharepoint Hosted app

I'm developing a sharepoint hosted Add-in, which should react to a change of a list field of a list in the hostweb. I need some kind of EventListener for a list field. For example: List field Gets ...
1
vote
1answer
773 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 ...
1
vote
3answers
4k views

How to Make Webpart Title to Display Day of the Week?

I have list View webpart in my sharepoint 2010 team site home page. Generally Web Part title can be easily modified by editing the webpart and providing Title value. I am looking for a solution to ...
1
vote
1answer
83 views

Add sharepoint menu ellipsis to end of Document Library using javascript

I have a document library in SharePoint 2013 with a number of different views and I want to add the menu ellipsis (...) at the end of each view by using javascript in the masterpage. I know how to do ...
1
vote
1answer
236 views

Add a sequence to list SharePoint 2010

I have a problem of sequence in the list SharePoint 2010. I need a column Sequence with format 000001. This column is in type of single text. I think the best way is customizing a workflow, but I ...
1
vote
1answer
342 views

Sharepointplus: Trying to acces values in a SP list, but returning only nulls. (SP 2013) SOLVED

My goal is to read columns from the list TestList and write the element into an other list's new form's textbox TestText. But looks like even if I can acces the TestList the script return only with ...
1
vote
1answer
117 views

Not able to run any script on new list experience forms

I have to do some customization on a couple of list forms (new, edit). These lists have the new list experience mode enabled. But whenever this mode is enabled I can't seem to be able to: Use ...
1
vote
0answers
354 views

Javascript to: get username, lookup id in list, then update list item

I have a pretty complex task I need to perform in Sharepoint, but I'm a total beginner when it comes to JavaScript! Here's what I need to do: I have a list on my site that is basically a database of ...
1
vote
2answers
173 views

How to embed remote/dynamic JS in a page?

I have several pages and instead of including my JavaScript in each page and then updating/amending the script in each page which is time-consuming, I just want each page to pull the script from a ...
1
vote
4answers
2k views

Format Date (25 Jul) using Javascript Object Model

I am using sp2013 and building display templates. I would like to build a locig in javascript object model to get a date field back and display it on a page e.g. var itemDate = $getItemValue(ctx, "...
1
vote
1answer
136 views

Quick Launch with dynamic width

Is there a possibility to assign the width of the quick launch dynamically based on content? In our case the text is sometimes too long to display the whole text. Thank you.
1
vote
2answers
6k views

SP 2010 CSOM Javascript: serverRelativeUrl fails

I have a custom html and javascript file housed within a document library of a subsite: http://teamsite/project/testing%20site/shared%20documents/test.html and http://teamsite/project/testing%20site/...
1
vote
2answers
630 views

How to hide SharePoint list columns from users based on permission

I need to hide "Approver" add "Title" fields in my SharePoint list. I used the following JS. <script type="text/javascript" src=class="vglnk" href="https://...SiteAssets/jquery- 1.10.1.min.js"<...
1
vote
1answer
3k views

How get item ID in JSLink on DisplayForm

I'm customizing the DisplayForm of a list, and I want put a button on footer to EditForm, but in the ctx has no edit form url and no CurrentItem.ID. How can I do this?
1
vote
3answers
14k views

Javascript in content editor web part not working after publishing the page

I have a publishing page in which I have placed content editor web part which contains the link to redirect the user to application page. Code in the content editor web part is: <script type="...
1
vote
1answer
675 views

Javascript not loading for users with Read permission

I got a Javascript on a Sharepoint 2010 site which is not loading for users with Read permissions. The Javascript is embedded in the site and users with Read permissions have access to it, but the ...
1
vote
2answers
672 views

Set focus on SharePoint 2013 Modal dialog

I am opening popup modal with below JavaScript code, which is working correctly. But is it possible that when modal dialog opens, cursor or focus should be on modal dialog rather than on parent page. ...
1
vote
2answers
2k views

Copying all the field's value of a list to other list using javascript

This JavaScript code copies title field of one list to other list. <script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "sp.js"); var siteUrl = 'url'; ...
1
vote
1answer
625 views

JSOM SP.ClientContext returning Error

When I attempt to do var ctx = new SP.ClientContext("https://siteurl"); var item = ctx .get_web() .get_lists() .getByTitle("Folder") ...
1
vote
1answer
3k views

How to access the data from Manage User Profiles?

We are have sync the SP with AD using Active Directory Import for SharePoint 2013. All the users have been picked up into the Manage User Profiles and new user properties have been added to the ...
1
vote
1answer
785 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. ...
1
vote
2answers
11k views

How do get selected item of list?

I have a webpart .I add a listviewbyquary in createchildcontrols and a hyperlink in visualwebpart. i use this http://graegert.com/featured/using-the-editorpart-to-create-a-custom-listview-web-part ...
1
vote
2answers
732 views

Sharepoint Multilingual App

I'm making an app with a custom list in multiple languages. Is there an easy way so that I only have to create the site columns, content type and list once? So I don't have to create them for each ...
1
vote
2answers
270 views

Find list element when page is loaded

I'm trying to get an element once page has been loaded. However when I put the code in window.onload = function () { my code }; it's not working, without window.onloadit get's the element. here's my ...
1
vote
2answers
3k views

Insert JavaScript into Web-Part

I have inserted into my Home.aspx a list with Web-Parts like this: Now I want to know how can I apply JavaScript to this list? Note: I want to display an image depending of selected of one field
1
vote
2answers
5k views

Autopopulate form fields based on selection in people picker column using JavaScript

I have a custom list where user fills out profiles of others. There is a People picker column for "Name of employee" and when the user selects the person(people picker) in the form, other details ...
1
vote
1answer
533 views

JSLink for showing the Sum of my list columns will break if one item contain empty value.. it will return “NaN”

I am working on a sharepoint server 2016. and i want to show the sum of my list fields.. so i follow this appraoch:- https://social.technet.microsoft.com/wiki/contents/articles/30317.sharepoint-2013-...
1
vote
1answer
4k views

executeQueryAsync synchronously in each loop for sharepoint javascript model

I am performing looping in javascript for sharepoint. I want it to perform synchronously, means only after first data execution is done it should start with second. If first data execution is ...
1
vote
2answers
870 views

Problem with jQuery Function for Expanding Grouped Lists

In my portal, I have a custom list that is using grouping. Now, I want to automatically expand all the groups, so I have mustered this javascript/jQuery function. I use a delaying function to load ...
1
vote
1answer
566 views

How can you add a script reference to a page from a custom webpart?

I'm developing a custom webpart and I'd like to leverage jQuery for some of my client side functionality. I found a few articles that lay out the following technique for adding a script reference to ...
1
vote
1answer
20k views

getting list using JavaScript, error: Unable to get property 'apply' of undefined or null reference

In the context of a page in SharePoint 2013, I am trying to get items from a list using below code but when the query executes I am getting this error: SCRIPT5007: Unable to get property 'apply' of ...
0
votes
1answer
134 views

Push SharePoint Content To Excel Spread Sheet

I'm writing a code to get if versioning of documents in a SharePoint site is Enabled, or Disabled. I managed to get that working, but now I need to push the info to an excel file, the information that ...
0
votes
3answers
67 views

ADD Multiple UserID's into a column

I want to add multiple UsersID's into a column. Column type is "People and Group". Everytime it's inserted an userid, he smashes the other one, staying only one. Can someone help me? Thank You. //...
0
votes
1answer
631 views

Fetch MULTIPLE “Person or Group” values based on lookup selection

I have a list "List1" having following fields Department : Single line of text HOD : Person or group(Multiple values) There is another list called "List2" with following fields FacultyName : ...
0
votes
1answer
134 views

Approving the filtered values of list using javascript

I have a list, a list filter and two date filters(Start date and end date) in a page. First I have to filter list using this filters and then I have to approve whatever item are left in the list after ...
0
votes
1answer
560 views

Save conflict - reset ratings and ratingscount in presaveaction

In my Editform I wish to reset all the ratingcounts on save, however I am getting an error message Save Conflict. Your changes conflict with those made concurrently by another user. If you want your ...
0
votes
2answers
7k views

How to center a Picture Library Slideshow Web Part's Previous, Next, and Pause buttons

We have a Picture Library Slideshow web part added to our site but the buttons to control Previous, Next, and Pause/Play directly underneath it are off-center to the left for some reason. We need to ...
0
votes
3answers
72 views

How can I have yes, flagged and no buttons in a column

I have a document library where the CEO wants to see three buttons. If he has read the document he wants to click on Yes, otherwise it will always be No. If he clicks Flag it means it needs to be ...
0
votes
2answers
2k views

Display REST Data

I am running into few issues. Issue # 1: When I use the following REST endpoint uri in chrome I get XML back. However, IE throws an error (IE cannot display this feed). I downloaded REST API Browser ...
0
votes
2answers
1k views

Is there any way to access a managed meta data service using only javascript in SharePoint 2010?

I am creating custom forms in a SharePoint site. The only thing is most of our Lists contain managed metadata fields. I have been successful in adding new items to Lists having only standard fields ...
0
votes
1answer
35 views

How do I get column data from list webpart using javascript based on the webparts selected item

Scenario: I am trying to create a group mailto function for one of my SharePoint pages. The idea is that the user can select the groups they wish to bulk e-mail within our organisation. They click a ...
0
votes
1answer
295 views

Can UserCustomActions run on a web only?

In a site collection there is a particular subsite where I need to apply a UserCustomAction. It will be a basic JavaScript function that prompts for acknowledgement and sets a cookie. The need to do ...
0
votes
1answer
7k views

SP.Web.EnsureUser(user) does not seem to work. (JavaScript Client OM)

Supposedly, SP.Web.ensureUser(user) works according to this MSDN link but I cannot seem to get it to work in my JS code. While debugging, I can see that SP.Web exists and the user variable is ...
0
votes
3answers
9k views

Edit Item Form: Call function after commit (Custom Save Button)

I have a custom Edit form in SP2013 where I want the Save button to do two things: Commit changes Call JavaScript function The function in step #2 does several things including a workflow trigger. ...
0
votes
1answer
7k views

Retrieving and displaying custom list column names (which have spaces in them)

I have been to Jan Tiernans blog, and figured out how to grab column names using Soap and jquery/jscript. I can't figure out how to grab custom columns with special chars though. I have read about ...
0
votes
2answers
71 views

What kind of objects can I load for use by .executeQueryAsync?

I have set up an async query in javascript. I am able to send a list item and get the column values back. However, is there any way to send the webpart object itself or an entire list object so that I ...
0
votes
1answer
960 views

Create folders and subfolders in document library using client object model using JSOM/ECMAscript

Regarding the link below Create folders and subfolders in document library using client object model can i get the same functionality achieved using JSOM/ECMA SCRIPT
0
votes
2answers
3k views

Include javascript on application pages

I need to do some client-side alterations to some of the application pages, specifically the permission page (User.aspx). I need the javascript file to remove the "Administrate Parent Permissions" ...
0
votes
1answer
2k views

Upload new image in asset library in SharePoint Online

I am developing a SharePoint Hosted app for SharePoint Online. Now I wondered if there is a way to upload a new image file to the central asset library. I found several code snippets for C#, but my ...