Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi, I want to set field values mandatory in edit form using javascript based on values entered by the user.
Posted
Comments
Sandeep Mewara 8-Jun-11 8:22am    
Ok. And the issue is?

1 solution

This would require developing a custom form for the list or creating custom field controls
 
Share this answer
 
Comments
Rupesh Tarwade 9-Jun-11 0:59am    
Hello Mark,

I found that PreSaveItem in javascript fires before the save button function is called. Can this be used to perform the validation?

However, I am unable to get this thing work.
Rupesh Tarwade 9-Jun-11 8:04am    
SharePoint uses PreSaveItem internally to wireup PreSaveAction function. This code can be found in Form.js in Layouts folder.

function PreSaveItem()
{
ULSopi:;
alert('Inside PreSaveItem');
debugger;
if("function"==typeof PreSaveAction)
return PreSaveAction();
return true
}

So need to write the code in PreSaveAction method.

Thanks for the help/
[no name] 9-Jun-11 12:10pm    
All well and good but this will modify the functionality for EVERY edit form used for EVERY list on EVERY site in the SharePoint Farm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900