Skip to main content
Participant
April 12, 2024
Question

How do I pre-fill multiple fields with a percentage, based on two options from a dropdown?

  • April 12, 2024
  • 1 reply
  • 243 views

I am creating a form to use for 1000+ scenarios. I have calculations to do under two separate scenarios. If I select one dropdown option, I would like a set of 4-5 fields to pre-populate with a certain percentage. If I select another dropdown option, I would like it to pre-populate the same 4-5 fields with a different percentage. 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
April 12, 2024

As the custom Validation script of the drop-down you can use something like this (adjust the field names and values as needed, of course):

 

if (event.value=="Option1") {
	this.getField("Perc1").value = 0.1;
	this.getField("Perc2").value = 0.2;
	this.getField("Perc3").value = 0.3;
	this.getField("Perc4").value = 0.4;
} else if (event.value=="Option2") {
	this.getField("Perc1").value = 0.9;
	this.getField("Perc2").value = 0.8;
	this.getField("Perc3").value = 0.7;
	this.getField("Perc4").value = 0.65;
}