Sometimes, we want to lead a page to a particular url location after clicking the SharePoint default OK and Cancel Button. However, it seems there is no way to change it. There is workaround I found on:
http://anythingprogramming-emsomeone.blogspot.com.au/2011/09/change-default-sharepoint-ok-and-cancel.html
Requirement:
When you click on the sharepoint OK and Cancel button, it should be redirected to a different url.
Workaround:
Instead of using the default sharepoint buttons:
<SharePoint:SaveButton runat=”server” ControlMode=”Edit” id=”savebutton1″ Text=”OK”/>
<SharePoint:GoBackButton runat=”server” ControlMode=”Edit” id=”gobackbutton2″/>
replace them with this:
<input type=”button” value=”OK” name=”btnSave” onclick=”javascript: {ddwrt:GenFireServerEvent(‘__commit;__redirect={}’)}” />
<input type=”button” value=”Cancel” name=”btnCancel” onclick=”javascript: {ddwrt:GenFireServerEvent(‘__redirect={}’)}” />
*** Note:
– You can put any URL in the __redirect={} that you want, for example __redirect={http://www.google.com} or __redirect={/news/PressReleases/}
– There should be no quotes around the URLs passed into the __redirect directive