Posted by: R Manimaran | June 29, 2010

SharePoint PreSaveFunction() in Newform and EditForm aspx


This function is used to Execute any javascript function before saving a list item.  Return value from this function determines the Saving action of an list item.

Example: Place a ContentEditor Webpart in Newform.aspx and add this code

<script language=”javascript”>

Function PreSaveAction()


//you can place your validation function here.

return false; //the form will not get submitted

retrun true; //the form will get submitted.



You can add the content Editor webpart to Newform.aspx using Sharepoint designer or through editing the Page. But, how to edit the page and add a content editor web part?

Check my next post.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: