Adding conditional formatting on drop down options
Copy link to clipboard
Copied
I am working on a fillable form in Adobe DC that I would like to use conditional formatting. I have some text boxes that include a person’s name, email address and phone number. If there a way using conditional formatting, script or something else that will auto populate the email and phone once a person selects the name? All the boxes are drop-down. If so, how do I do that?
Copy link to clipboard
Copied
Are all dropdown fields already set with all the info?
If yes, then you can use "getItemAt()" method to populate phone and email fields.
Copy link to clipboard
Copied
Good morning Nesa. Yes, my drop downs already have that information loaded. I am new to this, how do I use the "getItemAt()" option?
Copy link to clipboard
Copied
First item in a list is at 0 2nd is 1...etc getItemAt(0),getItemAt(1), for example lets say you have name option "John Doe" and his info is at first position in dropdown and "Jane Doe" at second position and other dropdown fields are named "Phone" and "Email". As validation script of name dropdown field you could use something like this:
var cPhone = this.getField("Phone");
var cEmail = this.getField("Email");
if(event.value == "John Doe"){
cPhone.value = cPhone.getItemAt(0);
cEmail.value = cEmail.getItemAt(0);}
else if(event.value = "Jane Doe"){
cPhone.value = cPhone.getItemAt(1);
cEmail.value = cEmail.getItemAt(1);}
Copy link to clipboard
Copied
Hi! From everything I'm seeing, you are a guru with conditional formatting and coding! I am a beginner and am struggling to find coding to help with my project.
I am creating an interview guide for hiring managers to use and I'd like for specific competencies and interview questions to appear in text fields, based on the job role they select from the dropdown. Can you offer any recommendations?
Copy link to clipboard
Copied
To populate text fields with text depending on dropdown field choice, take a look at try67 post.
If that doesn't help, you can send me a PM with an exact description of what you want.
Copy link to clipboard
Copied
You can use a script on the main field. The others can be text fields, though. There's no reason to have them as drop-downs.
The script can be placed under the Validation event and can be something like this:
if (event.value == "John Doe") {
this.getField("Email").value = "John.Doe@company.com"';
this.getField("Telephone").value = "(555) 123-4567";
} else if (event.value == "Mary Jane") {
this.getField("Email").value = "Mary.Jane@company.com"';
this.getField("Telephone").value = "(555) 420-9999";
}
etc.
Copy link to clipboard
Copied
Thank you, for the information and the example! I will give this a try.

