If you’re customizing SharePoint listforms or SharePoint forms you have normally a save or cancel button. If you want to have a pre-action for the save button, that means there should something happen before the item will be saved if the user clicks on the save button, you can use the javascript function PreSaveAction(). This function takes place before saving the item.
I my customer project i need this function for the following scenario. The user has to choose a value from dropdown list. If the selected item from dropdown has a special value, the user should get a message, that informs him about a special situation and that he should confirm to proceed.
[sourcecode language=”csharp”]
[/sourcecode]
After that the message appears if you click the save button:
Hope this helps you.
I already posted about SharePoint forms or Listforms. Let me give you the links to my previous posts:
Part 1: Setting up a solution with a list definition, a list instance and deploy it.
Part 2: Creating a custom list form and connect it with the list definition.
Part 3: Necessary settings for custom listform in Visual Studio
Part 4: Override Save Button in listform
Part 5: How i can make attachments working in listforms
Hi
Where do I place the PreSaveAction() code in the custom list code in Sharepoint Designer 2010?