Change properties

Change properties

Postby Arunas » Fri Dec 30, 2016 7:53 pm

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 2685 times
1.png
1.png (2.67 KiB) Viewed 2685 times
Arunas
 
Posts: 16
Joined: Sun Feb 08, 2015 7:49 am

Re: Change properties

Postby mobilemcclintic » Sat Jan 14, 2017 4:52 am

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.
mobilemcclintic
 
Posts: 54
Joined: Fri Oct 23, 2015 8:04 am

Re: Change properties

Postby Arunas » Mon Jan 16, 2017 6:46 pm

Thank you. Works!
Arunas
 
Posts: 16
Joined: Sun Feb 08, 2015 7:49 am

Re: Change properties

Postby admin » Tue Jan 24, 2017 11:19 am

.
admin
Site Admin
 
Posts: 3079
Joined: Mon Jun 15, 2009 9:53 am


Return to Custom Code