Saturday, February 11, 2012

The Awesome PreSaveAction() javascript function in list form sharepoint 2010

PreSaveAction() in list forms runs before the list form data gets saved

How to define it?
If you are on one of the list forms(newitem.aspx,edititem.aspx,dispitem.aspx) in sharepoint designer-click on the "Edit In Advance Mode option"  find the "Main" content place holder in the page
Inside the content place holder copy paste below

<script type="text/javascript">
 function PreSaveAction()
{
alert('I will run before the form gets saved');
return true
}
</script>


Note : Don't forget to return true; otherwise the function won't fire ..

No comments:

Post a Comment