10
Jul
13

InfoPath 2010 Form: Redirect to your source Page once form has been closed

I’ve noticed that this topic has been asked about by many people and I thought I’d offer up what I did to eliminate this problem.

For those not familiar with this issue, when you create an InfoPath form and create Submit and Cancel buttons, it is likely you want the Cancel operation to redirect or return you to your originating page.  Some folks want to display a "Thank you" page after a submit and then return to their originating page.  While you can do this with scripting, such as JavaScript found here, I think I have a simpler method that doesn’t require you write any custom JavaScript (although it does use a built-in SharePoint JavaScript function).

The trick I used was to open the form in a dialog.  That way, when you click Cancel, the dialog is dismissed and you remain on the same page from which you opened the dialog.

Here’s some example html.

<a href="javascript:OpenPopUpPage(‘uploadfile.aspx?ProjectID={@PMO_x0020_Project_x0020_ID}’, RefreshPage);">

In this case, uploadfile.aspx is located in the pages library and is a custom page with an InfoPath form web part on it.  The custom page also has a URL filter on it that is connected to the form.  The parameter, ProjectID, is a URL parameter that is passed to the form through a web part connection.

Here is an image that has the above hyperlink (Upload File) anchored to it.

image

This opens the page below in a dialog.  Notice how the Project ID is defaulted on the form using a URL parameter that is sent to the form web part using a web part connection.

image

When Cancel is clicked, the dialog is dismissed and we’re right back where we started.

For the "Thank you" page, I’d recommend creating another view in InfoPath and simply switching views after the submit with your "thank you" text and provide an OK button to close the form.

Advertisements

2 Responses to “InfoPath 2010 Form: Redirect to your source Page once form has been closed”


  1. 1 Jon Doe
    January 13, 2015 at 9:43 am

    Is it possible to route to another parent page upon the dialogs closure? Essentially replacing refreshpage with a new URL to go to.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Asif Rehmani’s SharePoint Videos

SharePoint-Videos

Click to access a wealth of SharePoint videos

SharePoint Rx

SharePoint Rx Home

Categories

Posts by Date

July 2013
M T W T F S S
« Mar   Dec »
1234567
891011121314
15161718192021
22232425262728
293031  
Support Wikipedia

%d bloggers like this: