Tuesday, July 7, 2009

Customize Edit Page and Redirect page after update using java script

1. In Sharepoint Designer take your EditForm.aspx and copy it.
2. Rename it
3. Open this new form and click on the PlaceHolderMain (leave your ListFormWebPart on the page)
4. In the ListFormWebPart scroll down the properties in the xml which describes the webpart and change to false. For some reason the form will not work unless you leave the original on the page.
4. Click on Insert->Sharepoint Controls->Custom List Form
5. Choose the appropriate List and select Edit Form
6. Sharepoint generates the form for you.

To customize the save button, find the following control on the page Sharepoint:SaveButton

1. Delete the SaveButton
2. Add

input type="button" value="Save" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={Thanks.aspx}')}"

instead
3. This button allows the form to be saved and redirects to back to that page.