Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Cancel

Locked
rnott
Posts: 31
Joined: Fri Mar 14, 2014 6:14 pm

Cancel

Unread post by rnott »

I would like to add a Cancel button that will undo any changes the user has made since the last save and instantly take them to browse form.
I realize that I can click on breadcrumb, but It give message "Leave this form without saving".

Trying to give user a faster way to back out instead of having to click multiple times.
Thanks
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Cancel

Unread post by massiws »

rnott,
I think this is an extremely useful feature to avoid accidentally losing user's work, but if you want you can comment this two functions in index.php:
index.php.png
Max
You do not have the required permissions to view the files attached to this post.
Tinka
Posts: 73
Joined: Mon Feb 24, 2014 2:58 pm

Re: Cancel

Unread post by Tinka »

Max,

is it possible to disable these functions for a particular form only?

Tinka
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Cancel

Unread post by admin »

Tinka,

You could skip this warning by resetting edited..

Code: Select all

nuFORM.edited = 0;
or

Code: Select all

nuSetHash('edited', 0);
does the same thing.


Steven
Tinka
Posts: 73
Joined: Mon Feb 24, 2014 2:58 pm

Re: Cancel

Unread post by Tinka »

Steven,

I tried this in the Javascript tab

Code: Select all

function nuOnSave() {
nuFORM.edited = 0;
return false; //don't want to save the record, save button is removed
}
It did not work.

But putting nuFORM.edited = 0; on the onblur event on every form object skips the alert so I went with this.

Tinka
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: Cancel

Unread post by admin »

.
Locked