Link dropdown choice to autofill fields

Community Beginner ,
Apr 03, 2022 Apr 03, 2022

Copy link to clipboard

Copied

Can samebody please help me with setting this up to a form?

I needo to auto-fill a field based on a Drop-Down field choice, but i am a begginner with javascript.
Can some body give me a code for this?

Dropdown field is named FieldA, items are ChoiceA and ChoiceB.

This choice must fill another fields with 10 for Choice A or 15 for ChoiceB.

TOPICS
PDF forms

Views

60

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 03, 2022 Apr 03, 2022

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 03, 2022 Apr 03, 2022

Copy link to clipboard

Copied

Easiest way is to set those numbers as the export values of the items in the drop-down, and then use something like this as the custom calculation script of the text field:

 

event.value = this.getField("FieldA").valueAsString;

Likes

Translate

Translate

Report

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 Beginner ,
Apr 03, 2022 Apr 03, 2022

Copy link to clipboard

Copied

LATEST

This is EXACTLY what i need to do, but based on a drop down menu chioce. Thank you for your answer. I will paste my code until now, and you correct it, please?

What I need: i need to put your sugestion where it is read "D.0.0:" and "I.0.0"

// Nome das habilidades
var HabData = { Acrobacia:{ atributo: "D.0.0",
},
Leitura:{ atributo: "I.0.0",
}};
function SetFieldValues(cHabName)
{
this.getField("HabAtrib").value = HabData[cHabName].atributo;

}

Likes

Translate

Translate

Report

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