Welcome to the nuBuilder Forums!

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

Edit Form - additional Save button

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Edit Form - additional Save button

Unread post by Janusz »

I noticed that If I just press the tab in the nuTabHolder of the edit form it activates nuShow('button_save');
How to exclude tabs from from this script.
I was checking with .not('tab') , nutab, nutabs, nutabholder, and some more but could not identify the proper name for tab.

Code: Select all

if (nuFormType() == 'edit') {
var inputs = $("#nuRECORD").find(":input:not([type=button])");
    inputs.change(function() {  nuShow('button_save'); });
}
If you like nuBuilder, please leave a review on SourceForge
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 447 times
Contact:

Re: Edit Form - additional Save button

Unread post by kev1n »

Tabs are not included in the selection because their parent is not nuRECORD ( $("#nuRECORD").find(.... ). There must be another reason why the button becomes visible.

If I have a button on the form with this code, it will not become visible when I click on a tab. So I can't reproduce it like this.

Code: Select all

if (nuFormType() == 'edit') {
nuHide('button_save');
var inputs = $("#nuRECORD").find(":input:not([type=button])");
    inputs.change(function() {  nuShow('button_save'); });
}
Janusz
nuBuilder Team
Posts: 506
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 8 times
Been thanked: 18 times

Re: Edit Form - additional Save button

Unread post by Janusz »

Thanks for your feeddback.

I was using following function to hide the button:
$('#button_save').hide();

when I replaced it by:
nuHide('button_save');

it started to work proprerly :-)

By the way I noticed that object names are global - initially I thought that local (I am using button_save name on every form)
So if following function is defined in one form then it seems to be seen by the objects from other forms if the ID is the same (but still investigating it more)

Code: Select all

if (nuFormType() == 'edit') {
var inputs = $("#nuRECORD").find(":input:not([type=button])");
    inputs.change(function() {  nuShow('button_save'); });
}
If you like nuBuilder, please leave a review on SourceForge
Post Reply