PDF form dropdown not fully populating with javascript
Copy link to clipboard
Copied
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:
- 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.
- 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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I've attached the Adobe file. The javascript is in the Branch dropdown.
Thank you! (I'm not good at javascript!)
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
Thank you!
- Central City
- Grandview
- Kelowna Mission Park
- Maple Ridge
- New Westminster
- Prospera Centre Kelowna
- River District
- South Granville
- Sunwood
- Surrey Ctr
- West Oaks
- White Rock
Copy link to clipboard
Copied
I edited my post check EDIT part.
Copy link to clipboard
Copied
Thank you thank you thank you! It all works great!

