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
0 votes
1 answer
2k 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
1 answer
12 views

Host a static JS-enabled webpage behind SharePoint credentials

Looking for a simple solution. My clients want a static JS-enabled webpage deployed in such a way that users need to enter their SharePoint credentials in order to see it. As a result, we cannot put ...
4 votes
1 answer
3k views

401 (Unauthorized) in Google Chrome

When I Get the document list from SharePoint site I get this error "401 (Unauthorized)" only in Google Chrome, but in IE it works. This is my code function GetListItems() { var siteURL = "http://...
2 votes
3 answers
4k 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
1 answer
1k views

Call external API from SharePoint online using javascript

I am having HTML file for user input and use REST API for update into SharePoint list. we have a requirement to get value from external API. I am able run the below script from normal HTML form, and ...
0 votes
0 answers
19 views

POST drop down custom column selected value into SharePoint list

I have build a custom drop down field using HTML, the values in dropdown choice are coming from SharePoint list using GET API. I also added button with name "AddItem" in front of dropdown so ...
0 votes
1 answer
2k views

REST addViewField "Cannot handle the data at position 0."

I'm currently writing an initialisation script for a SharePoint-hosted application which checks if a list (used for launcher items) exists. If it doesn't, then it runs through a series of processes to ...
1 vote
2 answers
2k views

iFrame shows no scrollbars

I have a simple iFrame within a content editor where I want to add SP content (dynamically via JS): This is working fine... <iframe id="VersionHistoryFrame" src="http://www.test.de" width="400" ...
1 vote
2 answers
3k views

CAML Query for retrieving only document library items in only one folder

I'm trying to access the documents in a specific folder in a SharePoint document library. the library has multiple folders but I do know the name of the folder. here is an example of the file tree (I ...
0 votes
1 answer
1k views

Automatically update hyperlink to point to newest added document in a library

This is my first post here, so bear with me. I am reletivley new to SharePoint, however I do know my way around it. Basically on my site homepage I have promoted links set up along the top. One of ...
0 votes
1 answer
2k views

Hover images(Enlarge image on Mouse Hover) from SharePoint list 2013

We had SharePoint list with image column. Our request, when some one keep mouse on image column, picture need to enlarge(hover). Can someone suggest direct how to achieve with code. Thanks in advance ...
0 votes
2 answers
12 views

Running a function within a .ts file that is triggered by a button inside of a separate .tsx file

My issue is that there is an html button that exists inside of my. tsx file, and I cannot get a function to fire When that button is clicked. The tricky part is that I need for a function that exists ...
3 votes
5 answers
2k views

Need a way to identify files which have no checked in version

I wrote a script that traverses a collection, it's document libraries and gets a list of all files. I'm trying to find all the documents which do not have a checked in version and require a user to go ...
0 votes
2 answers
2k views

Unable to get property 'createRange' of undefined or null reference

I have a SharePoint custom list form with a bunch of Javascript running on it. In particular I have one field where it gets its choices from a lookup to another list. The lookup returns n versions of ...
0 votes
1 answer
887 views

Provide user a filtered set of managed metadata column values for filtering on a list view

Background/Problem Our customer recently switched from a choice column to using a managed metadata field to capture data in a list. They really love the ability to add new values on the fly, as well ...
0 votes
2 answers
1k 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 ...
3 votes
1 answer
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 ...
1 vote
3 answers
2k 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 = ...
1 vote
1 answer
1k views

Get List Items from Sharepoint Online to on Premises

I'm trying to get some list elements, using javascript code, from a Sharepoint online instance to the internal, on premises, Sharepoint instance. I've been looking for the past days at Sharepoint's ...
1 vote
1 answer
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 ...
1 vote
1 answer
3k views

How to count SharePoint list elements using CAML Query

I have got CAML Query. How to count how many elements is in the list checked ? Here is javascript code: var siteUrl = '/sites/MCUW-IT/kostka-pilotaze/restauracje-pilotaże/'; var clientContext =...
0 votes
1 answer
2k views

How to save CSV data to SharePoint 2013 list without iterating through the each record using JavaScript/REST?

I am having CSV with more than 3500 records. My need is to import the CSV data to SharePoint 2013 custom list. I have to achieve this programmatically. I have already tried some bulk operations/...
0 votes
1 answer
1k views

How to create a html form webpart filter for 2 list columns

I have a html form webpart (in the form of textbox input). I would like to filter 2 list columns using the same webpart: So instead of the usual filtering for 1 list column, this webpart will be used ...
1 vote
1 answer
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']")....
1 vote
1 answer
1k 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
1 vote
2 answers
1k views

Fluentui Grid not working in SPFx work bench and also as an installed app

i want to use the fluentui grid layout in the SPFx Webpart with React as Framework. the problem is that the grid is not working. As soon as i use it, it shows only the items under each other. how I ...
3 votes
2 answers
1k 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
1 answer
2k 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 "...
1 vote
1 answer
1k 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?...
1 vote
3 answers
15k views

Javascript not working in IE but work works in Chrome

I had a long search and until I found a working script to use the logged in user id. Finally I have found the following Javascript code, put it in XSL to be used in an XMl viewer web part: <script ...
0 votes
1 answer
2k views

double click on list row to open view form SharePoint 2013

Normally list items needs title field to open the item in edit/view form. I was just wondering is there any way to remove the title field and from the view and allow user to click on the row to open ...
0 votes
1 answer
1k views

How do I get all current users from a site

I need to get all currently active (not removed users) from a site. I have the following JS that gets all the users but some of them are old users that have been removed from the site (still exists in ...
1 vote
1 answer
2k 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
2 answers
4k views

Autocomplete field on Item Form

I spent some time looking up options for an autocomplete or searchable field on a form and decided to go with Anton Khritonenkov's instructions (http://www.codeproject.com/Articles/637675/Multiple-...
1 vote
1 answer
1k 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
2 answers
2k 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 ...
0 votes
1 answer
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
1 answer
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
1 answer
19 views

Retrieved value from field does not show correctly

I have a question regarding encoding I suppose. So when a user inputs in a form some value, like this for example: (bla {{blabla"bla bla bla" "some more bla bla bla" "bla&...
1 vote
3 answers
3k views

Unable to set value of dropdown on page load

I am using SharePoint 2013 online and I have created a form for my list using Infopath 2013. It has a combination of text fields and dropdowns. I am able to set the default value of text field using ...
1 vote
2 answers
4k views

SharePoint Online (Office 365) - AutoResolve people picker with current user and detect change in people picker value

I am trying to implement a solution in SharePoint Online by customizing the NewForm.aspx page of a out of the box Calendar List using JavaScript with the following requirements: When page loads, a ...
0 votes
1 answer
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
1 answer
2k views

uncaught syntaxerror unexpected identifier

I am trying to make some tabs that pull a webpart from the page and place the part in the tab, using Jquery's easyUI tabs. However, I am getting a syntax error in the following code: <!---->...
3 votes
2 answers
2k 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
1 answer
2k views

Adding Item to SharePoint list using Jquery

I am trying to create a button on SharePoint online classic page which will submit to a list. From there a flow will run. Just a question I have found an example how this can execute. A few ...
1 vote
1 answer
1k views

Sharepoint GetUserProfilePropertyFor not returning any results

I am trying to get the SharePoint 2013 API for GetUserProfileProperty, when I put the below url into a browser it works finr, however when i run the below code, I get no result (I do get a return, but ...
1 vote
1 answer
1k views

getItemByID is not a function

I have the following script that is returning the error message "list.getItemByID is not a function" and I can't figure out why. All examples use this function. I am trying to iterate through ...
3 votes
3 answers
2k views

Conditional formatting for SharePoint Online column.

I am working on a SharePoint Online 2016 site collection and need to add conditional formatting to a few drop down fields. The drop down options are: 1: Red, 2: Amber, 3: Green. I want the field in ...
2 votes
1 answer
1k views

check if User field value is a user or a group using CSOM/JSOM

I am able to get a user field and its value from a list using CSOM/JSOM. I cannot figure out how to get if the value is a user or a group. ExecuteOrDelayUntilScriptLoaded(function() { var context ...
2 votes
1 answer
3k 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 ...

1
2 3 4 5
108