Hot answers tagged

4

Actually haven't had my coffee jet and read your question like you needed help with MDS - if you wan't to enable MDS again (which you should do because it's actually awesome), below are some hints that will help you. Some troubleshooting help for your problem: Check your browsers console for errors Access the service via the URL directly (via browser ...


3

I had a similar requirement sometime ago. Due to browser compatibility issues, I ended up using window.prompt, shifting the control of the copy/paste functionality over to the user: window.prompt ("Copy to clipboard: Ctrl+C, Enter", text); BTW, the text will already be selected, so the user simply has to press CTRL+C. At the time I believe this is where ...


3

You can do it in SharePoint 2010 by querying following end-point. /_vti_bin/ListData.svc/UserInformationList Add your required properties in $select operator. /_vti_bin/ListData.svc/UserInformationList?$select=Id,Name,.. Example using jQuery function getUsers() { $.ajax({ url: "/_vti_bin/ListData.svc/UserInformationList", type: "...


2

First add a CEWP and add in this: <a onclick="goToAnchor('anchor')" href="#anchor">Anchor</a> <script> function goToAnchor(anchor) { var loc = document.location.toString().split('#')[0]; document.location = loc + '#' + anchor; return false; } </script> And down below where you want to go to (Slide to), add another CEWP and ...


2

Remove "." from your code at line number 3 i.e j(":input[title='Application Name']").val(); var j = jQuery.noConflict(); function PreSaveAction() { var txtTitle = j(":input[title='Application Name']").val(); alert(txtTitle); if(txtTitle == ''){ alert("Value Cannot be Blank"); return false; } else{ return true; } ...


2

For People picker field you have to get the html element using below snippet function PreSaveAction(){ SP.SOD.executeFunc('sp.js', 'SP.ClientContext', ValidateUser); return true; } function ValidateUser(){ var pickerDiv = $("[id$='ClientPeoplePicker'][title='<Field Name>']"); var peoplePicker = SPClientPeoplePicker....


1

For a people selector, try something like$("input[id^='YourPeoplePicker']").val() For a RTE, try something like var comments = $("div[id^='Richtextfield'].ms-rtestate-write").html().length; You really need to start leveraging the dev tools of your browser and use the jQuery help documentation, it is really helpful.


1

It is not totally clear whether you want to write the value to the list or just display the value. So here is another solution which only displays the value without actually writing it to the list: ExecuteOrDelayUntilScriptLoaded(sum, "inplview.js"); function sum(){ ReRenderListView_old = ReRenderListView ReRenderListView = function(ctx){ ...


1

You can get total of the current view from ctx.ListData.Row. var total = 0; ctx.ListData.Row.forEach(function(item) { total += item["column1"]; }); Then update the column2 using REST API function updateItem(url, oldItem, newItem) { $.ajax({ url: _spPageContextInfo.webAbsoluteUrl + url, type: "PATCH", headers: { ...


1

Not so trivial after all. I played around a bit and here is what I came up with: Notes first: You will need jQuery (at least on the DispForm.aspx of the Training Calendar list and on the NewForm.aspx of the Registration list) You Registration list needs a lookup column to the Training Calendar list You will have to deactivate Minimal Download Stratgy on ...


1

You have two problems: Your txtTitle1 variable is equal to $.(. Just remove that dot after the dollar sign. Your Description field seems to contain rich HTML because the field ID in the DOM contains the word _inplacerte at the end, therefore the value() jQuery function will not work since the field is not an input or textarea element, but rather a DIV ...


1

Here this code will work only in case of 2 fields available in your list. It will not work for more or less than 2 fields. Reason: CAML you are formatting is wrong. While building a CAML query it should be always in pair of 2 conditions CmalQuery += "<View><Query><Where><Contains><Or>"; while (e.moveNext()) { ...


1

Remove ' from the query and try like this CmalQuery += "<FieldRef Name="+fieldName+" /><Value Type=Text>" + txtValue + "</Value>"; Maybe this will work.


1

The below will return you the current value of the select field: $("select[title$='Phone Data Collection']").val() To put it as part of your logic you would do: if ( $("select[title$='Phone Data Collection']").val() =='SOME VALUE')


1

Try something like this: var count = 0; $("#UserOrgId").find("span.ms-RadioText > input").each(function() { if($(this).prop("checked")) { count += 1; } }); console.log(count);


1

Try this code SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function() { SPClientTemplates.TemplateManager.RegisterTemplateOverrides({ OnPostRender: function(ctx) { var calcColors = { 'Yes' : '#FFFFFF', 'No' : '#FF0000' }; var rows = ctx.ListData.Row; for (var i=0;i<rows....


1

Add this below given code in a CEWP (Content Editor Web Part). <script language="javascript"> function Custom_AddDocLibMenuItems(m, ctx) { var strDisplayText = Redirect to form here; var strImagePath = ; var strAction = 'window.navigate(/.../editform.aspx?Source= document.URL.substring(0, document.URL.indexOf(/Forms, 0)) ?RootFolder= GetUrlKeyValue(...


1

You can add Custom Action for list items using JavaScript. You have to set the appropriate document URL as a link. Adding a User Custom Action for List Items Using Javascript


1

This code is of retrieving user properties of current logged in user. you can read more in this article of how to modify the below code to obtain what you need. (function($){ $(document).ready(function(){ // Ensure that the SP.UserProfiles.js file is loaded before the custom code runs. SP.SOD.executeOrDelayUntilScriptLoaded(loadUserData, ...


1

SharePoint 2013 provides the SPClientPeoplePicker API to interface with the people picker. http://ranaictiu-technicalblog.blogspot.kr/2014/11/sharepoint-2013-client-side-people.html //Works with SharePoint 2010 $("div[title='People Picker']").text(strUserName); //Works with SharePoint 2013 try { //SharePoint 2013 ...



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