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

PDF form dropdown not fully populating with javascript

New Here ,
Jun 02, 2023 Jun 02, 2023

Copy link to clipboard

Copied

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

Views

458

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

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!)

Votes

Translate

Translate

Report

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

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).

Votes

Translate

Translate

Report

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

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

I edited my post check EDIT part.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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