Skip to main content
Participant
May 2, 2022
Question

Text field not fillable unless specific menu option is chosen

  • May 2, 2022
  • 1 reply
  • 527 views

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.

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
May 2, 2022

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;}

JayrocndcAuthor
Participant
May 2, 2022

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.

JayrocndcAuthor
Participant
May 2, 2022

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?