Hi,
I have a subform called sub_forta. In it I have several fields and among them, one type input (nuNumber) called sf_pes and the other type checkbox called sf_select.
I would like to know how the sf_select field can be disabled when it detects that the sf_pes field (corresponding to the same row) changes to a value other than null.
Thanks for your help...
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
How to condition fields in a subform
-
- Posts: 27
- Joined: Thu Sep 01, 2022 3:42 am
- Has thanked: 1 time
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: How to condition fields in a subform
Hi,
Add an onchange event for sf_pes and run the code below (untested):
Add an onchange event for sf_pes and run the code below (untested):
Code: Select all
const id = event.target.id;
const $sf_pes = nuSubformRowObject(id, 'sf_pes')
const $sf_select = nuSubformRowObject(id, 'sf_select');
nuEnable($sf_select.attr('id'), $sf_pes.nuGetValue() === '');
-
- Posts: 27
- Joined: Thu Sep 01, 2022 3:42 am
- Has thanked: 1 time