Hello -
I know it's possible to redirect users when the form has been submitted to a custom URL, but does any know if it's possible to redirect users when they click the cancel button? We have a form linked in a central library and would prefer to keep them out of the source list which is what is presented when they cancel the form.
Any suggestions and help will be appreciated.
Thanks!
Jason
Hi Jason,
You can easily do this by changing the Cancel button into a JavaScript button within its configuration, and writing a small JS function for it to call that redirects to the desired page.
Thanks
Thanks Mike. That's actually what we ended up doing after a little more research. Initially it wasn't obvious to us that we could update the button action, but after we discovered that, we were good to go.
i am new in Nintex form can you give me bit more description of what you have done with this?
Hi Dlyva,
These are the steps we took to accomplish the goal:
Form
- Expand the custom JavaScript section in form settings.
- We did something really simple and added the following: function doRedirect(){history.go(-1);}
Cancel Button
- For the cancel button behavior, we changed the default button action from Cancel to JavaScript.
- In the control settings window for the cancel button we expanded the Advanced section and added the following the Client Click field: doRedirect();
- We saved changes and that did the trick for us.
It's really simply but it let us return the user to the screen previous without worrying where the form link was referenced. Not sure if there's a better or different way, but I'm sure you can get pretty creative here depending on your requirements.
Cheers,
Jason
Thanks Jason
We are having this same issue, but our users are launching the form from an email that we provide them, therefore the history.go(-1) does not work for us. I tried so many variations of the following JavaScript but none seemed to accomplish what we wanted:
window.location.href = "http://www.Nintex.com";
window.location = "http://www.Nintex.com";
window.location.replace("http://www.Nintex.com");
We ended up using window.top.location.href= "http://www.Nintex.com";
There were two other ways to accomplish this, though, that we discovered during testing. The first was to pass in the query string variable Source=http://www.Nintex.com on the end of our Edit item link in the email, which worked.
We also created a label that had a hyperlink to the redirect page. We put the display name as Cancel and styled it to look like a button.
Hope this helps!
Sabrina
This document was generated from the following discussion: Redirect URL when user clicks Cancel Button