You can use below JavaScript function to execute any JavaScript Code in New or Edit Forms for SharePoint List before saving (When Pressing OK button this function will be fired first)
You can use this function for validation before PostBack
PreSaveAction()
{
//Add Your JavaScript Code Here Then Return True Or False
return false; // Cancel the item save process
return true; // OK to proceed with the save item
}
Hello,
ReplyDeleteDoes this function works also with Sharepoint 2003 (WSS 2.0) ? Because I tried in a NewForm.aspx, and it does not seem to work ?
Thank you for your answer
i did't work with WSS 2.0, but i think it work only in WSS 3.0
ReplyDeleteTested in SharePoint 2010 and works.
ReplyDelete