Custom List Forms and Redirecting after Update
// July 29th, 2008 // Sharepoint
One of my clients required a custom edit form for their editing screen where it would show certain fields and then redirect to a new page after the OK button was clicked. I had done this before at another client except i’d never found a way to actually redirect the page after the save. Here is an article on how to do that to.
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
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={}')}"
instead
3. This button allows the form to be saved and redirects to back to that page. See this article for more info
Hope it helps!
UPDATE:
If you wish to update after redirecting this is how i did it:
add in
ParameterBinding Name=”Source” Location=”QueryString(Source)”
to your paramterbindings list then add
xsl:param name=”Source”>0 /xsl:param>
xsl:variable name=”RedirectLoc”> xsl:value-of select=”$Source”/> /xsl:variable>
to your stylesheet
then the button should be:
input type=”button” value=”Save” name=”btnTopSave” onclick=”javascript: {ddwrt:GenFireServerEvent(concat(‘__commit;__redirect={‘,$RedirectLoc,’}'))}”/>









Hi when Im being redirected to the source I get a page error.
I checked the url and the dashes (-) in the source url are beign replaced with %2D.
any ideas?
Cheers
Great post, worked like a charm!
Hi
How can I redirect with custom values ? like CustomNewform.aspx?Title=FormFieldtitle so on the other page i will get the formfieldtitle from the previous one
Cheers
Hi,
I am Getting a page error…..Object Required
error at lin 533 char 8..
Any help..much appreciated..
Regards,
C
Works beautifully. Thanks.
For those getting page errors: check the syntax carefully. All those open and closed brackets and parenthesis got me at first.
Is it a good choice to use this tool?: Kaldeera Advanced Forms (http://www.kaldeera.com/en-US/products/AdvancedForms/Pages/default.aspx)
Thanx in advance
Thanks a lot.
This solution work fine in my case