New answers tagged

0

I have done something similar to this and used the PreSaveAction function as well. This should be a catch-all on a custom new form for all fields. This doesn't contain the conditional logic, but should lay some groundwork on how to select. The way I was flagging each field was by using the class requiredField on the <tr>, which is done by placing ...


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.


0

You should use SPClientPeoplePicker - default JS object for SP2013. More info see there: Get the ID and Name from multiple Client side People pickers to store in a list Using SPClientPeoplePicker you can read members, write member, use groups and filters


0

Here you go: var RequestedForpeoplePicker = this.SPClientPeoplePicker.SPClientPeoplePickerDict.RequestedFor_TopSpan; var RequestedForu = RequestedForpeoplePicker.GetAllUserInfo(); and my peoplepicker <div> <SharePoint:ClientPeoplePicker Required="true" ValidationEnabled="true" ID="RequestedFor" UseLocalSuggestionCache="true" ...


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 ...



Top 50 recent answers are included