Skip to main content
Participant
March 21, 2023
Answered

Dropdown box populating text after selection help

  • March 21, 2023
  • 2 replies
  • 809 views

Hello experts.  I am having trouble coding this PDF Form.

I am trying to have a drop box at the top of my form that gives the option to select a hospital.

Field1 has a selection of either Riverside Community Hospital or Los Robles Regional Medical Center

My text boxes below would need to fill in Field2, Field3, & Field4 information that corresponds to each hospital.

 

Here is what I have so far:  I've also tried to paste it in the validate and calculate custom fields and nothing is happening to my Fields below.  Please help! 🙂 

 

if(event.value == "Riverside Community Hospital"){
this.getField("field2").value = "Adrian Arevia";
this.getField("field3").value = "Zach Johnson";
this.getField("field4").value = "Adam Rudd";}
else if(event.value == "Los Robles Regional Medical"){
this.getField("field2").value = "Denise Bell";
this.getField("field3").value = "Andrew Lane";
this.getField("field4").value = "Natalie Mussi";}
else {
this.getField("field2").value = "";
this.getField("field3").value = "";
this.getField("field4").value = "";}

 

 

This topic has been closed for replies.
Correct answer Bernd Alheit

In the script use the correct field names.  JavaScript is case-sensitive.

2 replies

Participant
March 21, 2023

I have a new question if anyone can answer:

 

If an item in "field1"is selected (i have 2 site options to select from in this field) , is it possible to have another dropdown box change options to select from, depending on which site they choose in field1?  

 

Example:  

I select Riverside Community Hopsital in "field1"

My next selection in "field6" would show, "Internal Medicine, Emergency Medicine, OBYGN, Family Medicine."

But if I were to select in "field1" Los Robles Regional Medical Center, 

My dropdown box in field6 would show these options, "Internal Medicine, Emergency Medicine" only.  

 

Thanks in advanced for the help!

 

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
March 21, 2023

In the script use the correct field names.  JavaScript is case-sensitive.

Participant
March 21, 2023

Oh my goodness!  Having stared at it for hours a simple error such as case-sensative has corrected the problem!  Thank you!