cancel
Showing results for 
Search instead for 
Did you mean: 

Cancel button returning to current form

swap
Nintex Newbie
1 1 1,578

What would be the best ways to return to current form when you press Cancel button? I was looking for the confirmation message on cancel button as well. After struggling to get perfect solution on this forum, I managed to find workaround below on this issue.

1. Disable existing/default Cancel button by adding below rule on the button.

2. Create a JavaScript button called "Cancel" and add JavaScript function name, "DoRedirect()" under Advanced -> Client click field 

 

2. Place your new JavaScript button on existing Cancel button. 

3. Select Form Settings -> Custom JavaScript -> add below code

function  DoRedirect()
{
    if (confirm("Are you sure you want to cancel? if you cancel now, you will lose any data entered! Press OK to continue, or Cancel to stay on the current page.") == true) {
         window.top.location.href= "http://<YourSiteURL>/Lists/<ListName>" ;
return true;
    } else {
       
return false; 
    }
}

4. Save your changes and publish it. Have fun!!

Reference:- Redirect URL when user clicks Cancel Button 

1 Comment
cabeza
Nintex Newbie

Hi Swap,

if you only need to return to the same form when you click Cancel button, so you dont need any JS.

you can simply go to the button's Advanced settings ,  in the Redirect URL field, past the "New Item" URL