Looking for script help

New Here ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

If I have a form that includes a drop-down box with alpha choices A - Z and I want two different form fields to populate a numeric number based on the the alpha choice, what would that script look like? For example, if the letter "A" is chosen from the drop-down, I need the number "0" to populate one form field and the number "1" to populate another form field. It is possible to auto-populate two other form fields at the same time when the selection is made from the drop-down?

 

Thanks in advance if someone knows how to do this!

TOPICS
JavaScript

Views

49

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
Most Valuable Participant ,
Apr 21, 2021 Apr 21, 2021

Copy link to clipboard

Copied

LATEST

You can use something like this as the custom validation script of the drop-down:

 

var f1 = this.getField("Field1");

var f2 = this.getField("Field2");

if (event.value=="A") { f1.value = "0"; f2.value = "1";}

else if (event.value=="B") { f1.value = "2"; f2.value = "3";}

 

etc.

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