Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
1answer
794 views

ECMA script for checking active workflows for an list item

Hi i am having more than 1 workflow associated with the list if there is any workflow that is active for an item then i need to prevent starting another workflow for the same item. I am using the ...
1
vote
1answer
881 views

how to display a contacts list in accordion view?

I want to display a contacts list in SharePoint 2013 as accordion. I tried to use the code from https://code.msdn.microsoft.com/office/Client-side-rendering-code-ccdb2a0e/view/Discussions/0?...
2
votes
1answer
867 views

Remove list item permissions by role type using JSOM

I'm looking for a good way to remove all list item permissions on a certain list item of a specific role type using the JavaScript object model. With myListItem.get_roleAssignments().getByPrincipal(...
0
votes
1answer
16 views

Sharepoint 2013: Moving a field o be side by side with another field doesn't save it

in an list/EditForm.aspx, I have the following code to copy/paste a field to another place: var dest = $('span[title="MyTitle"]').parents("tr:first"); // place to be copied var source = $("input[id*='...
5
votes
4answers
10k views

JS files returning Cached (Old) Versions Despite Update

We are currently in the wild throes of a migration from SP 2007 to SP 2010. I'm attempting to move some custom JavaScript Validation from the current production site to our staging site. My ...
0
votes
1answer
38 views

Javascript code inside my aspx page layout were smarter than i thought, and worked well on different regional settings and date format out of the box

I am working on an enterprise wiki site collection inside SP on-premises 2013. and inside the page layout i added this javascript, which get 2 date fields values from the current page (expirydate &...
0
votes
0answers
26 views

Document Open In IE

I have a pdf documents stored in SharePoint document library. By default the document open in Edge as the browswer is fine for some of the other documents in the library but the others I want to open ...
0
votes
1answer
16 views

REST API or CSOM JS GetList return URL

I need to get url list, Title is ready, Title is not equals url. var clientContext = SP.ClientContext.get_current(); var website = clientContext.get_web(); var list = website.get_lists().getByTitle("...
2
votes
3answers
929 views

pass parameter to 2nd function jsom

Hi I have the following code, how can I pass oList into function onQuerySucceeded? function lockMandaysItems(tID,oList) { var clientContext = new SP.ClientContext.get_current(); var oList = ...
0
votes
1answer
848 views

How to change default view of library using javascript or programatically?

I have a requirement where I have to change view based on users logged into the portal. If user belongs to guest view then view should be different and if he is logged in as admin a different view ...
0
votes
1answer
19 views

How to dynamically bind the HTML table and show as modal popup in JS file [closed]

I want to create a HTML table dynamically in .js file and want to show it as a Modal popup.I can't add HTML controls in .js file since it shows syntax error. I have provided the code sample. any help ...
0
votes
1answer
14 views

Get Workflow Status Programmatically in SharePoint Using Client Side Object Model JavaScript

I am trying to monitor the status of workflows using JavaScript in the SharePoint Farm. List A: Number of Completed: In Progress: Error occurred: List B: ...
0
votes
1answer
32 views

Javacript as Webpart to change Content Types

I am not allowed to change the Content Type of a file using the Quick Edit. I was wondering if there is any JavaScript code that I can add as a Web Part to the document Library. This code should ...
0
votes
1answer
24 views

How to set SharePoint list column font color using JavaScript

My question can be answered via two different ways: 1) How can I set the font on columns = white (to fake them being hidden)? I currently tried to use FieldName.fontcolor("white") and FieldName....
0
votes
0answers
15 views

Add validation to a Date field inside our publishing site's page layout using JavaScript/jQuery

I am working on an enterprise wiki site collection inside sharepoint farm 2013. I have a Date field named "ExpireDate" and i added it inside the EnterpriseWiki.aspx page layout. Here is the markup for ...
1
vote
4answers
1k views

Hide empty columns in view

its possible to hide empty column(s) from view(webpart) in Sharepoint 2013? I was looking for any javasript solution, but unfortunately i have found only solution for boxed style. Hide columns from ...
0
votes
1answer
19 views

Creating Custom WebPart — RangeErrror / TypError trying to access data from a file

Hi I'm new to using SharePoint and I'm trying to transfer over an Employee Directory Search app from a website to SharePoint Foundation 2013. I'm not able to use the same code in my .JS file and am ...
0
votes
1answer
863 views

Javascript and add user to Active Directory group in Sharepoint

How to add user to active directory group? How can I add user to the Active Directory by the javascript code. I have got a script which adding to Sharepoint Group, but how Could I do it with Active ...
1
vote
1answer
895 views

Issues with SPFilterDropdown in SPD2013

To start things, I have little knowledge beyond the basic concepts of SPD and being a newbie... What I want to accomplish is to only have certain values from another list show up in which their ...
0
votes
2answers
922 views

how to retrieve all surveys in my site using javascript/csom

I have created some surveys using survey app,I want to list all surveys existing on my site using client object model.
0
votes
1answer
866 views

Reset sharepoint lookup with None option using jquery

How to reset the lookup value to None in Editform.aspx page using Jquery. I want to empty the lookup dropdown if text box does not have any value . Here is the code which i have tried.I was able to ...
3
votes
1answer
919 views

ctx.CurrentItem undefined in new function

I am editing a item display template in SharePoint 2013. The following problem occurs: ctx.CurrentItem becomes undefined in a custom function. How can I solve this? Here is a little code snippet: ...
0
votes
1answer
869 views

Image Overlay with Text using javascript in Sharepoint referencing to a “List Library” (adjust frame size)

Below is my code for displaying images with text overlay (referencing from one of my list). <style type="text/css"> .myFrame1 { position: relative; overflow: auto; } .myFrame1 li { list-...
0
votes
0answers
9 views

Picture Library Slideshow Web Part Image Resize

So I have a folder with some images with the same dimensions and I am trying to have a slideshow in the homepage with these images. Everything is working fine except that there is a significant white ...
0
votes
1answer
548 views

How i can change the Label for my Discussion Board App from “new discussion” to something else

I am working on SharePoint online 2013. and i add a new Discussion Board App inside my Team site collection. now i name the new app as "News & Announcement", so i was expecting that the defualt ...
0
votes
2answers
640 views

jQuery.addClass working in Chrome but not IE11

I'm working with a "new item" form for a SharePoint survey. In Chrome, the following code shows an alertbox and then makes every other row darker. In IE 11, the following code shows an alertbox but ...
0
votes
2answers
38 views

How to SP2013 list put it into DataTable dynamically?

I have a sharepoint 2013 list with some items, I need to put it into DataTable dynamically, is possible create the html table automatically?
1
vote
2answers
3k views

Delete all items in Recycle Bin using javascript

Is there a way to batch delete all items in the recycle bin on the client side in SharePoint Online? I've tried using javascript:emptyItems() in the browser but this appears to time out after ...
0
votes
1answer
23 views

Get item from external list field with ajax - SP2013

I have a list and some columns retrieve value from external list. How to get all items from that list(attached img) with REST I'm trying like this function traerSolicitudes() { var lista = "...
0
votes
2answers
89 views

Get Page Field Values with javascript

We are using SP 2013 publishing features and have the document id service turned on for our site collection. So each new page has a document id assigned to it. We also created a custom content type ...
1
vote
1answer
870 views

current user is always is administrator on a SharePoint App

I have tried following solution to check the current user's permissions on the current host web in a SharePoint hosted app, however the user is always administrator. function sharePointReady() { ...
3
votes
2answers
844 views

Get object of ribbon button in JavaScript

I am trying to access the ribbon button via JavaScript. Below is my code: // Get the page manager var ribbonPageMgr = SP.Ribbon.PageManager.get_instance(); // Get the ribbon var ribbon = ...
0
votes
0answers
13 views

Include external script in display template

I'm creating a custom search result display template. I'd like to reference an EXTERNAL javasacript. The only examples I've seen copy the JS file into a library on the server and reference it from ...
0
votes
2answers
1k views

All of the sudden i get “Unable to get property 'split' of undefined or null reference”

I have a SharePoint public site branded and it was working fine when out of the sudden the slider with images stopped appearing and I get this error : Unable to get property 'split' of undefined or ...
1
vote
1answer
1k views

SharePoint 2013 Timeline Coloring

I want to color a timeline with data of a specific column. This column is named Topic. So I wrote some code and added it to my SharePoint site but it didn't work. Here's the code I used: var ...
4
votes
1answer
333 views

Print Files through SPFx/JS?

I would like to build a button which would send a batch of files to the printer when clicked (It can prompt the user. Doesn't need to go to the printer without approval). The files would exist in a ...
2
votes
1answer
531 views

Search API not returning all user objects

I'm trying to use sharepoint search rest api to return all the users in my organisation but it's missing a few for some reason: This is what I'm trying: var url = _spPageContextInfo....
1
vote
1answer
882 views

How to check page layout from javascript of current page in sharepoint 2013?

Does anyone know how to check page layout from javascript of current page in sharepoint 2013? Ideally I would prefer to not use any ajax calls. Thanks
0
votes
1answer
933 views

Getting error “Object doesn't support property or method 'commitPopup'” when saving a new alert in SP 2010

In my SP 2010 environment, I have a html page, that has an iframe, and the iframe is the page where you create a new alert for a list. In the html page, I dynamically create the iframe and then insert ...
0
votes
1answer
17 views

What are the required modifications in web.config in sharepoint site to expose URL to ajax call

I'm new to working with sharepoint. When i tried to call share point API url from ajax call in JavaScript. But, it's continuously failing and throws the error. I can say, that is CORS error. So, i've ...
0
votes
1answer
1k views

Sharepoint doesn't always execute script

So i have a webpart where some very smart people have hardcoded the number of items to show... So i've insert some javascript in a script editor to show more items (since those smart people just add "...
0
votes
1answer
7 views

ECB Menu “strAction” last value array

Created an Element in the ECB menu with dynamic items, when you try to access an item by clicking, the entire array is traversed and the last item is substituted, help the clicker to display the value ...
1
vote
1answer
1k views

SharePoint custom edit form button javascript onclick set fields value

I'm fairly new to developing and I have a custom form that I made using SharePoint designer 2010 - I need to start my workflow on the click of the button, but I'm not using a site based workflow, so ...
3
votes
2answers
1k views

How to restrict the number of lines to show using jquery or css?

i have created simple Custom webpart. It looks like in that web part, Description display multiple line . i have used html P tag to display Description value <p>​Loream Ipsum​Loream Ipsum​...
0
votes
2answers
629 views

Adding a Child Node Link to Heading - SharePoint Navigation using JavaScript

I'm currently trying to create a "Child Node" using Javascript by grabbing the users input and selection of their "Heading" where the Child node is going to go under. function addNavigationNodesChild(...
0
votes
2answers
23 views

CSOM Copy List Items

I was create Ribbon Custom Action, and try to copy list items selected to same list, but F12 error? what is the problem? function runCode() { var targetListItem; var values = SP.ListOperation....
0
votes
1answer
923 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
1k views

Group by field using jQuery

Say I didn't want to use the Group By option in an out of the box view to group my list by a certain field. Is there a way to achieve this using jQuery, JavaScript or something other front-end code?
0
votes
0answers
18 views

Accessing and counting from same list only works once

I've been trying to show a count subtracted from a maximum of 35 for a seating count. I've tried everything I can think of and have come to a dead end for myself. What am I doing wrong in my below ...
0
votes
0answers
14 views

How to chain promises for multiple ajax calls to SharePoint to get user ids?

Broken promises, thought I had it figured out, still trying to get reliable results. Console log shows hit and miss results. Below is the rundown of what I'm trying to achieve. Is there a simpler way ...