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!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
So I tried this and it doesn't seem to be working... any other suggestions?
Copy link to clipboard
Copied
You need to provide more details. What does "doesn't seem to be working" means, exactly?
Does something happen at all when you change the value of the drop-down field? If so, is it incorrect? Are there any error messages in the JS Console? etc.