Question

I am using SharePoint 2013 OP with SharePoint Designer 2013.

I created a Custom List to recieve problem reports. Using SPD 2013 I created a "NewForm.aspx" and used the following code for a redirect to a thank you / confirmation page:

<SharePoint:SaveButton RedirectUrl="http://mysitecollection/Pages/Thank-You.aspx" runat="server" ControlMode="Edit" id="savebutton2"/>

When the user submits the form and hits save, the form resets and clears. It does not actually redirect to the page specified.

Any help would be appreciated. Thanks.

Was it helpful?

Solution

Instead of Server side' Save Button, use the input button and ddwrt:GenFireServerEvent to navigate to the custom page as shown below.

With a custom data validation function(), ValidateData():

<input type="button" id="btnSave" value="Save" onclick="javascript:if( ValiateData() ){ddwrt:GenFireServerEvent(concat('__commit;__redirect={','http://mysitecollection/Pages/Thank-You.aspx','}'))}"></input>

Without a custom data validation function:

<input type="button" id="btnSave" value="Save" onclick="javascript:{ddwrt:GenFireServerEvent(concat('__commit;__redirect={','http://mysitecollection/Pages/Thank-You.aspx','}'))}"></input>


Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top