Copy link to clipboard
Copied
I searched the forum for this - and apologize if an answer is out there.
I created a PDF that has a dropdown menu called "Options"...with 12 options.
One of the drop down options is PIII and I have three fillable text fields that correspond with that option:
Type of PIII Funding
YOF
PIII CF
What I would like to do is have those text fields not fillable/"locked" - unless the user chooses PIII from the drop down menu.
Thank you in advance for any assistance.
Copy link to clipboard
Copied
As custom calculation script of dropdown field use this:
if(event.value == "PIII"){
this.getField("Type of PIII Funding").readonly = false;
this.getField("YOF").readonly = false;
this.getField("PIII CF").readonly = false;}
else{
this.getField("Type of PIII Funding").readonly = true;
this.getField("YOF").readonly = true;
this.getField("PIII CF").readonly = true;}
Copy link to clipboard
Copied
Thank you for the quick response. The good news, the fields are locked. The not so good news, after picking PIII - I cannot edits those fields.
Copy link to clipboard
Copied
User error - I was able to get the code to work. Thank you!!
Is there a way to also automatically clear/erase text in the fields, if anything other than PIII is selected from the drop down menu?
Copy link to clipboard
Copied
Yes, replace 'else' part with this:
else{
this.getField("Type of PIII Funding").readonly = true;
this.getField("Type of PIII Funding").value = "";
this.getField("YOF").readonly = true;
this.getField("YOF").value = "";
this.getField("PIII CF").readonly = true;
this.getField("PIII CF").value = "";}