Enabling a readonly field based on codition

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
jpwallace
Posts: 47
Joined: Fri Mar 03, 2017

26 Apr 2017

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

jpwallace
Posts: 47
Joined: Fri Mar 03, 2017

26 Apr 2017

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

jpwallace
Posts: 47
Joined: Fri Mar 03, 2017

26 Apr 2017

sorry, found my error, I missed () off of setDueDate();

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests