Redirect Submit or Cancel Button to Previous Site (New Responsive Form)

  • 6 August 2020
  • 5 replies
  • 372 views

Badge +4

I'd like to Redirect the user to the previous page they came from after clicking the Submit or Cancel button.  I found a post  that explains how to do this by creating a function (doRedirect(){history.go(-1);}) in Java, but is this option available in the Responsive form?  If so, where do I find it?

 

Or, is there another way to redirect the user to the previous page they came from?

Thank you.


5 replies

1. you can use 'Redirect to URL' property available for the button settings. 


2. If you are adding a link to the form anywhere, you can use source parameter of the url


     ex: http://xyz.com/lists/test/newform.aspx?source=RedirectURL

Badge +4

Thanks for your response.


You explained how to add a Redirect URL to a button.  I already do that, but I'd like to redirect the user to whatever URL they came from.  For example, if the user was on an internal team site and clicked a link to my form, I'd like to send them back to that internal page after they click save.  I have found posts on how to do this with java, but I don't see how to add java code to buttons on New Responsive forms.  Does that make sense? 

As i said above you can use source parameter, while adding a link to the internal team site, add source parameter to the url
ex: http://xyz.com/lists/test/newform.aspx?source=InternalTeamSiteURL

Keep 'Redirect to URL' button property empty while using source parameter.
Badge +4
Sorry, but I am still missing something. How do I know where the user came from? If they are on an external site immediately before they open my form, I'd like them to be redirected back to that external site after they click Submit or Cancel. What would I type in the source parameter, to direct them back to whatever url they came from? For example, if they came to the site from a bookmark, I'd like to send them back to the site they were at immediately before launching the form. If I was able to use Java, I would do something like doRedirect(){history.go(-1);}. But, it appears Java is not available in the new Responsive form.
Badge +2

Open the form from any view and look at the URL in the browser for the “Source=http….”

the “Source” will be the VIEW they initiated the form to edit or new

So, In the Close/Submit section of the Form INSERT this:  getQueryStringParameter("Source")

 

Reply