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
140 views

Access an item in a list in a subsite with Javascript(Solved)

function Testing() { var context = new SP.ClientContext('/Testing'); documents = context.get_web().get_lists().getByTitle("Site Assets").getItems(); context.load(documents); ...
1
vote
2answers
316 views

Expand collapse text on a Wiki page

I am trying to have a section of text on a Wiki page hidden by default, but when clicking on a link/header the text is then unhidden/expanded. I have searched online and thought I was getting ...
0
votes
2answers
447 views

Trigger JavaScript on Custom Action Ribbon/Menu Item

I have two custom actions that are currently deployed to a SharePoint 2013 Forms Library. They are working perfectly fine with the exception of a less than favorable method. What happens now is that ...
1
vote
1answer
69 views

Editing Managed Metadata List columns using JavaScript

I am attempting to update a list outside of my app web. When I find the list, I am finding my column, then casting that into a TaxonomyField. The purpose of casting is to be able to play with ...
1
vote
2answers
169 views

Insert a list item using REST form webpart: 403 error even when X-RequestDigest is present

I intend to insert a list item from the main page in intranet to a list hosted on another site collection. I made this simple HTML & JS to get it done, but I always get the 403 / FORBIDDEN error: ...
2
votes
1answer
60 views

executeQueryAsync fail on Chrome

I am using SP.ClientContext (JS library) to update some item's fields. It is working fine on IE but on Chrome I get this error (displayed as alert): Request Failed, status code 0 text '' The ...
0
votes
0answers
45 views

Modal dialog loads hosting page after action

I have a user for which I want to "pull out" the user management screens by providing links to modal dialogs. This works just fine until we start adding users. This action opens a second window to ...
3
votes
1answer
441 views

JSOM - get listitem by file URL

Task Abridgment - Access item attribute from a picture library by picture url. Long - When editing a pagelayout and an image is added to the page, the image's description should be loaded. This is ...
0
votes
1answer
259 views

Hide ribbon control in newform.aspx & editform.aspx

I want to hide ribbon form my newform.aspx & editform.aspx forms only. I don't want to hide ribbon from my whole site. I just want that whenever a user add or edit item top ribbon must be hidden ...
0
votes
0answers
81 views

Get List by “InternalName”

I'm trying to use the SharePoint 2013 JavaScript Object Model to retrieve a List via an internal name equivalent. SPList doesn't have a Name or Internal Name property. It is referred to by the ...
3
votes
1answer
1k views

SharePoint 2013 REST - Create list item with user field and lookup field

I'm trying to add an SPListItem to an SPList via REST, but have a problem with User or Group and Lookup (information already on this site). function adddullitem() { var item = { ...
4
votes
3answers
161 views

JavaScript is breaking my theme in SharePoint 2013

I am having an unusual problem. I have a site in SharePoint 2013 I just stood up, and starting to experiment with JavaScript and jQuery. I am using one of the OOTB themes, not ready to monkey around ...
0
votes
1answer
59 views

How to validate parent list data while creating new child item

I am having a parent list and child list. Parent list (Contract) is having an Contract Num, Contract Amount, Start Date and End Date columns. Child list (Project) is having and Project Name, Parent ...
0
votes
1answer
65 views

SP2013: Custom script interfering with OOTB ribbon controls

I've got a weird one here, and my JavaScript/SP2013 skills aren't up to the task apparently. I've got a custom script that I made by bashing together other scripts & snippets from around the web. ...
0
votes
1answer
100 views

Displaying list from another site collection, want items to open in a modal dialog

Here is the code I'm using. Keep in mind that I know practically nothing about javascript and borrowed the code from someone else. He hasn't had time to look at it yet. I'm just trying to modify it to ...
1
vote
3answers
871 views

Sharepoint- Client Object Model - Javascript - How to check if a particular file with same name exists in a document library folder

I am using javascript sharepoint 2013. I want to know how to check if a file exists in a folder, before i upload. Here's my code // Folder Name - folder into which I need to upload var ...
0
votes
1answer
33 views

2 client contexts using the same success method

Is there anyway to have 2 client contexts in the same success method like so var clientContext = SP.ClientContext.get_current(); var peopleManager = new ...
2
votes
1answer
64 views

Count characters in text field

I have a simple custom developed list that contains three columns, one of these columns should take maximum 7 characters, otherwise problems are caused, thus I want to make the user aware of the ...
0
votes
0answers
15 views

custom page allowing verification of existing item

The scenario is that I need a multi stage pages. Ideally I would like to do this on a single page but for simplicity 2 pages are fine. On the 1st page I need to verify if an item exists in the ...
1
vote
2answers
37 views

Get the field “Created”

I have a list "Consult", and I want get the field "Created" this is my code: function consultWorkOrder() { try { var customlist ; var clientContext = new ...
0
votes
1answer
102 views

Check if the user has attached any file

When I open(edit) some item in a list I want to check with JavaScript if the user has attached any file in my Edit Form...
0
votes
0answers
63 views

javascript not rendering on display template

While creating Display Templates, I am working on a control template. I have three javascript files and a css file that's not rendering. I have checked the path and ran full crawls, below is the code. ...
0
votes
1answer
72 views

object object from get_userProfileProperties() stringify

var clientContext = SP.ClientContext.get_current(); var peopleManager = new SP.UserProfiles.PeopleManager(clientContext); // Get user properties for the target user. // To ...
7
votes
2answers
206 views

Disable ECB flyout menu in Sharepoint 2013

SharePoint 2013 introduced a new flyout on list items instead of a drop-down context menu. When you click the 3 dots next to a list item or document, you get the flyout. You then have to click the 3 ...
0
votes
2answers
253 views

How to find relative URL of a document library using JavaScript?

What I am trying to do is to enable the dialog with the metadata information when I drag and drop a file in a document library. The same dialog that appears when you upload a file through the +New ...
0
votes
0answers
22 views

finding if a user profile property is in the edit page section

Basically as the title says how can I find out which of my user profile properties are in the edit page using javascript. my code is : var MyProperties, getMyNewsChoices = function () { ...
0
votes
0answers
34 views

User Profiles get properties and calculate the percentage of empty properties

I've been playing around with user profiles and come across this SP.UserProfiles.PeopleManager.getPropertiesFor(accountName) however I am not sure how to implement what I want to do. I want to loop ...
0
votes
1answer
180 views

SP2013 online : set_formDigestHandlingEnabled Error

I get the error : Object doesn't support property or method 'set_formDigestHandlingEnabled' when I try to get the current SPContext object from javascript code in an Office 365 site. I am ...
2
votes
2answers
296 views

Creating Folder using REST and JavaScript

I'm trying to create a Folder in a SharePoint Image library. I found an answer here but I can't seem to get it to work var web = 'my relative path to the current web'; var lib = 'name of the image ...
2
votes
2answers
275 views

Copying files AND folders via REST/Javascript

I'm trying to build a the following functionality into a library view: Each document has a checkbox beside it User checks off which documents/folders they want to copy User clicks a "Copy Files" ...
1
vote
1answer
318 views

How to check if current user belongs to SharePoint group

I have a custom list with a script (JavaScript) allowing me to add some features/customisations to my list. More precisely, I have a function in my script which creates an hyperlink according to a ...
0
votes
1answer
57 views

Modal Dialogue Behavior On Close

I'm using a modal dialogue to display list data formatted by DataTables. Within the table are links to another modal dialog to edit items in the first modal dialog's table. I'm turning on the save ...
0
votes
1answer
122 views

Implement multi select lookup using listbox control in aspx page

How can I implement the multi look up select list items functionality in SharePoint using asp.net C#? Please help me with some code, I am using two list boxes and have added a add remove button on ...
0
votes
1answer
84 views

400 (Bad Request) ERROR while trying to use JS files in Content Editor Web Part

So, I added some code in Content Editor Web Part and code is started like this: <script src="/<MyURL>/_layouts/15/SP.Runtime.js" type="text/javascript"></script> <script ...
0
votes
0answers
15 views

Resource field SharePoint 2013 calendar

I have a Resource field in the calendar in SharePoint 2013 in which user have to add the required resource. But i want to set the default value for the the resource field,so that user should not ...
3
votes
1answer
310 views

How to get ClientPeoplePicker value using javascript

can anyone please tell me, How to get ClientPeoplePicker value using javascript.?
1
vote
0answers
28 views

Sequential number generator with a twist

I have an assets list. The asset needs to have an asset number assigned upon creation. The format of the number should be A-99999. There are existing asset numbers I have to work around in order to ...
3
votes
1answer
37 views

Script editor webpart ribbon problems

I added a script editor web part (javascript code) to a view page (/Forms/AllItems.aspx). After that I can not see anymore the File and List category in the ribbon bar. I read somewhere that ...
0
votes
2answers
30 views

Change By Name in sharepoint Blog site

How can i change the by name in blog site?. I checked that it is redirecting to /_layouts/userdisp.aspx?ID=17. I can get this id by running the below power shell script. But how can i change it in the ...
1
vote
3answers
153 views

CAML query rertieve all items from a SharePoint list

I have a JavaScript piece of code that I use to retrieve list item from SharePoint by selected options from drop-down list. Depending the selection it would assign a value to a CAMLQuery variable. ...
0
votes
1answer
76 views

Identify if a Library item is a folder or not in CSOM

I have Library on which I have created a ribbon button. On click of the button I am trying to identify if the selected item is a folder or a file. below if the code snippet that I am using: var ...
-1
votes
1answer
87 views

Add/delete list item using knockoutjs

I need knockout js code to add/delete a list item. Any ideas?
3
votes
1answer
170 views

Suspend and resume SharePoint Online workflow using CSOM - Ecmascript

I have a requirement where the Master user has power to interrupt any workflow and put it on hold and the approvals should be stopped on that workflow until the Master user resumes the workflow. When ...
-1
votes
1answer
34 views

input box in sharepoint to add entry, popup

I have a button, when i click on button i need a popup which should have textbox and a button "ok". in textbox i can enter numerical values like 10, 12 etc and click on ok button. Later ok button ...
0
votes
2answers
130 views

Cascading dropdown not working

I am trying to get cascading dropdowns to work on a list, but I seem to be missing a point somewhere. Please help me out. I have added jQuery and jquery.SPServices to my masterpage. The dropdown ...
1
vote
0answers
36 views

To Scroll to the top of page

I'm using angularjs & sharepoint 2013. I have implemented the SPA model in one page where the entire page refresh may not happen. Here, the scroll bar is not always going to the top of page since, ...
2
votes
1answer
100 views

SharePoint 2013 and javascript

What is meaning of OnDemand scripts and what is not-on-demand scripts? In SharePoint 2013, when do we use SP.SOD.executeFunc and when to use ExecuteOrDelayUntilScriptLoaded ? What is best practice?
0
votes
2answers
510 views

get Library document URL using Javascript client object model

I am working with SP.js to get data from a SharePoint library. Below is the code i am using: var clientContext = new SP.ClientContext(); var oList = ...
0
votes
3answers
145 views

Could JQuery or JS disable core.js?

I have a strange situation. I using the code below in a Java Script file and referencing it from CEWP. For some reason, I can't do Page or Site Action Edit anymore, it does not do nothing. However, if ...
2
votes
2answers
158 views

How to retrieve all items from a list by javascript object model and store it to array

I'm new to JavaScript Object Model in SharePoint 2010 and want to get some idea of that. I wrote below code to get all list items of a SharePoint library. This works fine and return all items. But I ...