Skip to main content
Participant
Mar 21, 2023 12:00 AM UTC
Answered

Dropdown box populating text after selection help

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 is closed to new replies. Start a new post to keep the conversation going.
Bernd Alheit
Bernd AlheitCorrect answer
Community Expert
Mar 21, 2023 3:19 AM UTC

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

3 replies

Participant
Mar 21, 2023 6:30 PM UTC

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!

 

Translate
Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
Mar 21, 2023 3:19 AM UTC

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

Translate
Participant
Mar 21, 2023 3:39 PM UTC

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

Translate