Skip to main content
Participant
June 2, 2023
Question

PDF form dropdown not fully populating with javascript

  • June 2, 2023
  • 1 reply
  • 1384 views
0

I'm using javascript in a pdf form, I have a dropdown that references a location. When the user selects that location, the form is supposed to populate with information related to the location.

 

I have two issues:

  1. The issue is that only some locations are populating with the information related to the location. I can't identify why. When I put the info into a javascript tester, it comes back with no errors.
  2. I need the form to, when the user clicks on a blank location (as in, no location), the form clears any other information that populated from before. For example: I selected the location: Jasper and it populates with the Jasper information. But that was an error and I want to not have any information show up, I want to click on a blank in the drop-down and the form does not populate any information.

 

Thank you!

Cindy

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
June 2, 2023

Did you add a clause in your code to handle those cases?

You will need to post the code, or better yet, the actual file, for further help with this.

CindyLDAuthor
Participant
June 2, 2023

I've attached the Adobe file. The javascript is in the Branch dropdown.

 

Thank you! (I'm not good at javascript!)

Nesa Nurani
Community Expert
Community Expert
June 2, 2023

blank space is " " not "" so change:

if(event.value == "")

to:

if(event.value == " ")

EDIT:

When you have two words you need to put them in quotes, it should be "West oaks" and "White Rock"...etc (include quotes also, or it won't work).