none
Open URL on button click.

    Question

  • I am writing a form where upon clicking a submit button, it sends the user to a url. I wish the form to be browser-enabled, and I can publish as an administrator-approved form template. I have tried Process.Start, but for some reason that doesn't work. I have also tried Response.Write and Server.Transfer but neither of those work because with Response I am not using an ASP page.

    Does anybody know how to redirect to a web page after pressing a button in infopath on a browser-enabled form?

    Tuesday, May 25, 2010 6:52 PM

Answers

  • Sure. When you open InfoPath Web Form, you can pass Source in your URL: i.e.: Then you can set up an action "Close the Form" on a button Click, or after submit, and you will be automatically redirected to that URL.

    http://sharepointserver/_layouts/FormServer.aspx?XmlLocation=/TestForms/form1.xml&Source=<your url>

     

     


    Paul Shkurikhin blog.sharepointalist.com
    • Marked as answer by Michael Wiley Friday, April 29, 2011 5:23 PM
    Wednesday, May 26, 2010 5:26 PM

All replies

  • The simple answer is - no way.

    There are some workarounds though:

    1. When you "close" the form, it will be redirected to whatever url you have defined in Source query string. But you have to define that URL beforehand.

    2. If you simply want to show some kind of thank you page, you can show another InfoPath Form View instead.

     


    Paul Shkurikhin blog.sharepointalist.com
    Wednesday, May 26, 2010 6:26 AM
  • Could you elaborate more on your first solution, or point out some links to guide me?

    Also, no, I plan to link to an external page, so the second solution would not work.

    Thanks for the help, sincerely: Michael Wiley

    Wednesday, May 26, 2010 2:50 PM
  • Sure. When you open InfoPath Web Form, you can pass Source in your URL: i.e.: Then you can set up an action "Close the Form" on a button Click, or after submit, and you will be automatically redirected to that URL.

    http://sharepointserver/_layouts/FormServer.aspx?XmlLocation=/TestForms/form1.xml&Source=<your url>

     

     


    Paul Shkurikhin blog.sharepointalist.com
    • Marked as answer by Michael Wiley Friday, April 29, 2011 5:23 PM
    Wednesday, May 26, 2010 5:26 PM
  • Is there any way I could do:

    http://<spserver>/_layouts/FormServer.aspx?XmlLocation=<form>&Source=http://<targeturl>/<file>.php#<username> ?

    Thursday, May 27, 2010 12:57 PM
  • Sure, but keep in mind that you need to generate this url for the user. You can use javascript on a page, or do a webpart, or generate it from the workflow to use in email - whatever you want.
    Paul Shkurikhin blog.sharepointalist.com
    • Marked as answer by Stanfford Liu Friday, June 04, 2010 10:40 AM
    • Unmarked as answer by Michael Wiley Friday, April 29, 2011 5:23 PM
    Tuesday, June 01, 2010 8:14 PM
  • I'm sorry, I know this is quite a while past the date of this question being asked, but I wish to redirect to a site using the infopath userName variable, does infopath add any extra functionality for this? Some type of submit rule or custom code I could use?
    Thursday, November 11, 2010 4:44 PM
  • I am writing a form where upon clicking a submit button, it sends the user to a url. I wish the form to be browser-enabled, and I can publish as an administrator-approved form template. I have tried Process.Start, but for some reason that doesn't work. I have also tried Response.Write and Server.Transfer but neither of those work because with Response I am not using an ASP page.

    Does anybody know how to redirect to a web page after pressing a button in infopath on a browser-enabled form?

    Not with a button you can't but if using a hyperlink is an option that could be a workaround:

    The url of the startscreen of the workflow should you start it manually has three parts: 

    <https://first part><ID><last part>

    So step 1 is create a calculated field CreateWorkflowLink or whatever name suits you: 

    ="<first part of url...&ID=>"&ID&"<last part of url>"

    Step 2 is create a hyperlink in the Infopath form Click here to start the workflow that has your calculated field as the datasource for the hyperlink.

    that's it!

    Friday, March 02, 2012 3:34 PM