Page 1 of 1

Enabling a readonly field based on codition

Posted: 26 Apr 2017
by jpwallace
Hi, is there a way to enable a read only field based on when a check box is ticked.

I have a due date as read only and a check box to extended due date, when the check box is ticked I want to enable the due date field

Cheers

Re: Enabling a readonly field based on codition

Posted: 26 Apr 2017
by jpwallace
I have this working to some extent, I am currently using.....
function setDueDate() {
if (fd.field('ExtendDueDate').value() == '1') {
fd.field('DueDate').readonly(false);
} else {
fd.field('DueDate').readonly(true);
}
}
fd.field('ExtendDueDate').change(setDueDate);
setDueDate;

once opening my edit form, the first time I check the box nothing happens, I uncheck... when I check again that is when the read only field becomes editable and I can change the date..... where am I going wrong??

Cheers

John

Re: Enabling a readonly field based on codition

Posted: 26 Apr 2017
by jpwallace
sorry, found my error, I missed () off of setDueDate();