Welcome to the nuBuilder Forums!

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

Hide subform depending on value on parent form

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
Duski
Posts: 95
Joined: Thu Mar 04, 2021 2:03 pm

Hide subform depending on value on parent form

Unread post by Duski »

I'm trying to hide subform frmsub_pozicky depending on value on parent form tbl_media_id - to hide if tbl_media_id=1
My custom code for Edit is:

Code: Select all

var p=tbl_media_id;
if(p==1){
     nuHide('frmsub_pozicky')
     };
But subform hides for all values tbl_media_id.
Whats wrong in my code ?
Thanx in advance.
kev1n
nuBuilder Team
Posts: 4305
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Hide subform depending on value on parent form

Unread post by kev1n »

Code: Select all

var p = tbl_media_id.value;
if (p == 1) {
    nuHide('frmsub_pozicky')
};

or

Code: Select all

var p = tbl_media_id.value;
if (p == '1') {
    nuHide('frmsub_pozicky')
};
Duski
Posts: 95
Joined: Thu Mar 04, 2021 2:03 pm

Re: Hide subform depending on value on parent form

Unread post by Duski »

Thank you, Kev.
It works !
Post Reply