Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Change properties

Locked
Arunas
Posts: 21
Joined: Sat Feb 07, 2015 11:19 pm

Change properties

Unread post by Arunas »

Hi,

I need, IF Field1 value enter 'Yes', THEN Field2 property 'Read only' becoming 'No'. How?

Thanks
Attachments
2.png
2.png (3.2 KiB) Viewed 7539 times
1.png
1.png (2.67 KiB) Viewed 7539 times
mobilemcclintic
Posts: 54
Joined: Fri Oct 23, 2015 12:34 am

Re: Change properties

Unread post by mobilemcclintic »

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.
Arunas
Posts: 21
Joined: Sat Feb 07, 2015 11:19 pm

Re: Change properties

Unread post by Arunas »

Thank you. Works!
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

Re: Change properties

Unread post by admin »

.
Locked