Page 2 of 2

Re: Edit Form - additional Save button

Posted: Fri Jan 18, 2019 11:59 pm
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'); });
}

Re: Edit Form - additional Save button

Posted: Sat Jan 19, 2019 8:09 am
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'); });
}

Re: Edit Form - additional Save button

Posted: Sat Jan 19, 2019 11:10 am
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'); });
}