Hi,
I need, IF Field1 value enter 'Yes', THEN Field2 property 'Read only' becoming 'No'. How?
Thanks
Welcome to the nuBuilder forums!
Please register and login to view forums and other content only available to registered users.
Please register and login to view forums and other content only available to registered users.
Change properties
-
- Posts: 21
- Joined: Sat Feb 07, 2015 11:19 pm
-
- Posts: 54
- Joined: Fri Oct 23, 2015 12:34 am
Re: Change properties
I'd use Custom Code and events to do that task for you.
For example, in Custom Code\Javascript, you could use:
function nuLoadEdit() {
if('#Field1#' == 'Yes') {
$('#Field2').prop('readonly',false);
}
}
in order to set the field property to editable when the record loads if Field1 is Yes,
then create a function that enables/disables Field2 if you change Field1 to Yes kind of like:
function field2_en () {
if ($('#Field1').val() == 'Yes') {
$('#Field2').prop('readonly',false);
}
else {
$('#Field2').prop('readonly',true);
}
}
Then on Field1's properties, in the Events tab, create an onchange event and call field2_en();
When you select Yes on Field1, Field2 should turn editable. If you open a record that has Yes in Field1, it should also be editable.
The harder part for me is deciding the exact circumstances for when you want to enable or disable something, and if you want to change or empty fields if (in your case) Field1 was changed to blank or No.
For example, in Custom Code\Javascript, you could use:
function nuLoadEdit() {
if('#Field1#' == 'Yes') {
$('#Field2').prop('readonly',false);
}
}
in order to set the field property to editable when the record loads if Field1 is Yes,
then create a function that enables/disables Field2 if you change Field1 to Yes kind of like:
function field2_en () {
if ($('#Field1').val() == 'Yes') {
$('#Field2').prop('readonly',false);
}
else {
$('#Field2').prop('readonly',true);
}
}
Then on Field1's properties, in the Events tab, create an onchange event and call field2_en();
When you select Yes on Field1, Field2 should turn editable. If you open a record that has Yes in Field1, it should also be editable.
The harder part for me is deciding the exact circumstances for when you want to enable or disable something, and if you want to change or empty fields if (in your case) Field1 was changed to blank or No.