Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PDF form dropdown not fully populating with javascript

New Here ,
Jun 02, 2023 Jun 02, 2023
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

TOPICS
Acrobat SDK and JavaScript
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 02, 2023 Jun 02, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 02, 2023 Jun 02, 2023

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

 

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 02, 2023 Jun 02, 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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 02, 2023 Jun 02, 2023

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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 02, 2023 Jun 02, 2023

I edited my post check EDIT part.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 02, 2023 Jun 02, 2023
LATEST

Thank you thank you thank you! It all works great!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines