Hot answers tagged

5

Suppose you have: A page at the following URL: https://Your_Site/Site Pages/ThankYou.aspx. A form https://Your_Site/Your_List/Forms/NewForm.aspx Now, what you want to do is to make sure users access the form via the following hyperlink: https://Your_Site/Your_List/Forms/NewForm.aspx?Source=https://Your_Site/Site Pages/ThankYou.aspx Notice the ?Source= ...


2

Please take a reference of below steps: 1, Prepare lists: 2, Insert Code: https://github.com/kongmengfei/sharedproject/blob/master/jssharing/johnjohn/treeview.html Result: BR


2

Probably Typescript type-check does not recognize the inline object as PlainObject: settings Type: PlainObject (source) You could try this var requestBody = JSON.stringify(fileData); var settings: Object = { url: requestUri, type: "POST", headers: requestHeaders, data: requestBody }; return $.ajax(settings);


2

Try using below code which is working fine for me: <script type="text/javascript" src="/sites/SPConnect/SiteAssets/jquery.min.js"></script> <select name="cars" id="ddlphysicalVirtual"></select> <button type="button" onclick="getChoiceOptions()"> Get Choice Options </...


2

Your issue is that you cannot create a new item directly on a List object. Lists contain item collections, and you need to create the new item in the item collection of the list. So, the URL you specify when making your POST to create the new item, which is currently: url: "https://baseurl.sharepoint.com/sites/Projects/USMC/AMMO/_api/web/lists/...


1

Ok, first, as a side note, I see you are using _spPageContextInfo.siteAbsoluteUrl to build your REST API URLs. I would highly recommend switching to use _spPageContextInfo.webAbsoluteUrl because siteAbsoluteUrl is going to give you the absolute URL of the root web in the Site Collection, so if you happen to be working in a sub-site within the site ...


1

Yeah, the problem is that when you define your insertChartData function, you are saying you are expecting it to get data passed in, but when you actually call it, you are not passing anything to the function. $(document).ready(function () { // putting insertChartData(data) here does not pass data into the function. // this is the function definition,...


1

Follow below pattern for code to work: $(document).ready(function() { var endpointUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('ListName')/items"; loadChartData(endpointUrl); }); function loadChartData(uri) { $.ajax({ url: uri, method: "GET", headers: { "Accept&...


1

As per my understanding (Correct me if I am wrong), you forgot to add the type="button" to your button element. So, Add type="button" to the button element like: <button type="button" id="button_overview" onclick="yourFunction()">Click Here</button> Reference: prevent refresh of page when button ...


1

As you are not able to use jQuery/.ajax, you can also use JSOM for CRUD operations. Follow below link for creating list items & adding attachments: To create a new list item: How to: Create, Update, and Delete List Items Using JavaScript What is best practice to add list item in SharePoint 2013 javascript object model? To add list attachments: Upload ...


1

Technically this question should be posted on StackOverflow, because this is a JavaScript programming question that doesn't really have to do with SharePoint. Yes, you are getting some results from SharePoint, but what you are talking about is just transforming one JSON data structure into a different JSON data structure. That being said... here's what you ...


1

Hide the group totals in a SharePoint 2013 classic view <style> .ms-gb>span{ display:none !important; } </style> Result Hide Totals for the first level only $(".ms-listviewtable tbody[id^='aggrWP']").hide() Hide Totals for the first level only (ms-gb) $( document ).ready(function() { $(".ms-gb").parent(...


1

Try this: $('<text-input-selector>').trigger( jQuery.Event('keypress', { keyCode: 13 }) ); Replace <text-input-selector> with appropriate jQuery selector for your input field. If you are not able to get the correct selector then let me know and share the screenshot of textbox element by inspecting it. I will help you with jQuery selector. ...


1

Change the source parameter only works for cancel button. As Denis Molodtsov said, it would not work for save button. As a workaround, you could try the below code: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><script type="text/javascript"> $(function(){ var button = $(&...


1

The style display property is used to hide and show the content of HTML DOM by accessing the DOM element using JavaScript/jQuery. To hide an element, set the style display property to “none”. document.getElementById("element").style.display = "none"; To show an element, set the style display property to “block”. document.getElementById(&...


1

To hide a SharePoint column of the type choice - drop-down the HTML control will be a select field instead of input. Simply, $('select[id*="Name_"]').closest("tr").hide();


1

Solution using JQuery: Have you referenced jQuery file in your code (I suspect you haven't)? If Yes then below code should work for you: $("input[title^='Request ID']").val(AutoIncremental); If you have not referenced JQuery file then you can refer it like below in your HTML and then use same code as above: <script src="https://ajax....


1

Please try the below code in browser console: var pdfItems = [{ID:1, Skills: [{Label: "ASP.Net", TermGuid: "0207fb4e-cff9-43b9-8c27-2225ff2bde78", WssId: 24}, {Label: "Java", TermGuid: "4b01e476-0864-434b-9dfe-d576b4451c3f", WssId: 7}, {Label: "Javascript", TermGuid: "1d0c4e05-c1f6-4f3a-accd-66e5f334d3f0&...


1

Assuming you want to disable the form fields on Edit form. For Single line of text field: Consider column name is - Title $(document).ready(function(){ if($("input[title^='Title']").val()) { $("input[title^='Title']").attr("disabled", "disabled"); //$("input[title^='Title']").attr(&...


1

You can design a flow that is triggered by HTTP-request. Just describe the schema of the request body and pass any parameters in the body of the post-request as demonstrated here: https://flow.microsoft.com/en-us/blog/call-flow-restapi/


1

First of all, your getFormDigest function is not quite right: function getFormDigest(baseurl) { // you pass in a "baseurl" value above, but you're not really doing anything with it. // the URL you use below is hardcoded to always // make the request to the /sites/Projects/USMC/AMMO site return $.ajax({ url: "...


Only top voted, non community-wiki answers of a minimum length are eligible