Redirect URL when user clicks Cancel Button

Document created by robert.harding@semperian.co.uk on Jun 30, 2015
Version 1Show Document
  • View in full screen mode

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

  1. Expand the custom JavaScript section in form settings.
  2. We did something really simple and added the following:  function doRedirect(){history.go(-1);}

Form Settings.png

Cancel Button

  1. For the cancel button behavior, we changed the default button action from Cancel to JavaScript.
  2. In the control settings window for the cancel button we expanded the Advanced section and added the following the Client Click field:  doRedirect();
  3. We saved changes and that did the trick for us.

Control Settings.png

 

 

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

Attachments

    Outcomes