Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Autopopulate text field based on drop down menu.

Avatar

Level 1

Ok.  I know alot of people have asked questions about this but none of them seem to match what I need to do.

I am trying to make an equipment request order form that will be automatically filled out based upon what is selected from a drop down menu.  For example if someone selects "ACLS" text box 1 would automatically generate with "Adult CPR Maniken" and text box 2 would generate "Child CPR Maniken".  If someone was to select "PALS" text box 1 would automatically generate "Infant CPR Maniken"....and so forth.  Any help would be greatly appreciated.  I am just a Paramedic with some computer skills, not an expert by any means!

Thanks!

4 Replies

Avatar

Former Community Member

If you define the drop-down as...

Untitled.png

You can add the following script to the drop-down exit event to populate a text field.

// form1.page1.subform1.dd::exit - (JavaScript, client)

form1.page1.subform1.tf.rawValue = form1.page1.subform1.dd.rawValue;

Steve

Avatar

Level 1

Thanks Steve.  That helps alot.  But is there a way to have the drop down menu generate text in multiple text fields.  Example:

Drop Down Menu selection is "ACLS"

Text box 1- Adult CPR Maniken

Text box2- Defibrilator

Text box3- ACLS Drug Box

and so forth.

That is what I am really trying to do here if it is even possible.

Thanks!

Avatar

Former Community Member

OK.

// form1.page1.subform1.dd::exit - (JavaScript, client)

var dd = form1.page1.subform1.dd.rawValue;

switch (dd) {

  case "ALCS":

    form1.page1.subform1.tf1.rawValue = "Adult CPR Maniken";

    form1.page1.subform1.tf2.rawValue = "Defibrilator";

    form1.page1.subform1.tf3.rawValue = "ALCS Drug Box";

    break;

  case "PALS":

    form1.page1.subform1.tf1.rawValue = "Child CPR Maniken";

    form1.page1.subform1.tf2.rawValue = "Widget";

    form1.page1.subform1.tf3.rawValue = "PALS Drug Box";

    break;

}

Steve

Avatar

Former Community Member

Awesome Steve - thank you so much, you just save me alot of time I don't really have. Joanne