Edit Form - additional Save button

Questions related to customising nuBuilder Forte with Javascript or PHP.

Re: Edit Form - additional Save button

Postby Janusz » Sat Jan 19, 2019 8:29 am

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'); });
}
Janusz
 
Posts: 170
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Edit Form - additional Save button

Postby kev1n » Sat Jan 19, 2019 4:39 pm

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'); });
}
kev1n
 
Posts: 190
Joined: Mon Oct 15, 2018 2:13 am

Re: Edit Form - additional Save button

Postby Janusz » Sat Jan 19, 2019 7:40 pm

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'); });
}
Janusz
 
Posts: 170
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Previous

Return to Custom Code