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!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
How to condition fields in a subform
-
- Posts: 30
- Joined: Thu Sep 01, 2022 3:42 am
- Has thanked: 1 time
-
- nuBuilder Team
- Posts: 4562
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 528 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: 30
- Joined: Thu Sep 01, 2022 3:42 am
- Has thanked: 1 time