Redirect URL when user clicks Cancel Button

  • 30 June 2015
  • 5 replies
  • 80 views

Badge +2

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


5 replies

Badge +9

Great summary of all the options Eric Harris

Badge +6

Thanks SO MUCH for the suggestion to simply add a label for the CANCEL button that redirected to the page of my choice.

I tried the other suggestions----but in every situation it did not apply to go back ONE page----often times a user would need to go back TWO pages to make the doRedirect(); option work properly.  So that option did not work for me.

But creating a simply lable worked beautifully every single time.

Thanks again Sabrina!

Badge +6

Great post, I have a question, It would be possible create a button and then go to the edit form/ approval/ reject form.

I have a list and each item need approval so can I access to the approval/ reject form by clicking the button instead of receiving an email? 

Thank you

The URL redirect doesn't include option of referencing a named control i.e. I was going to redirect to Edit a specific List item based on user choice (form control).  So - right now - I don't see how I can redirect dynamically based on the data in the form controls. 

Badge +1

Is there a way to do this in Nintex for SharePoint? I'm using v2.9.2.20 and don't appear to have the 'Redirect URL' option.

Reply