Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Adding conditional formatting on drop down options

New Here ,
May 19, 2021 May 19, 2021

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?

TOPICS
PDF forms
2.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 19, 2021 May 19, 2021

Are all dropdown fields already set with all the info?

If yes, then you can use "getItemAt()" method to populate phone and email fields.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 20, 2021 May 20, 2021

Good morning Nesa. Yes, my drop downs already have that information loaded. I am new to this, how do I use the "getItemAt()" option? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 20, 2021 May 20, 2021

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 17, 2023 May 17, 2023

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 17, 2023 May 17, 2023
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 20, 2021 May 20, 2021

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 20, 2021 May 20, 2021

Thank you,  for the information and the example! I will give this a try. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines