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

Making Dropdown Selection Causes unrelated fields to disappear

Contributor ,
May 16, 2021 May 16, 2021

Copy link to clipboard

Copied

I posted a mess yesterday but I have cleaned it up to repost in hopes of figuring why a dropdown is causing unrelated fields to disappear. Selecting TRAILER button begins the process; choose TRAILER TYPE (Travel, Camping, or Park); Choose "Yes" to select the trailer to be permantly fixed to the ground (select 'Yes' radiobutton). It doe'sn't matter how you make the next selections until you get to the CustomerCountyCodes2dropdown. Making a selection here makes either the 'BodyTypeTTTrailer' or 'BodyTypeVTTrailer', and the 'TrailerConvertedMobileHomeText' fields reappear, which I want to keep hidden. In the CustomerCountyCodes2dropdown, I've tried javascript variations of value, valueAsString, and no value associated with the field variable, but nothing seems to work.  This CustomerCountyCodes2dropdown also contains a validation script to display a CityCodedropdown based on the County Selection from the CustomerCountyCodes2dropdown.

 

Searching for guidance as to why the three fields ( BodyTypeTTTrailer/BodyTypeVTTrailer, and TrailerConvertedMobileHomeText) reappear on making a selection of the CustomerCountyCodes2dropdown. Thanks in advance- kemper

TOPICS
General troubleshooting , JavaScript

Views

568

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

correct answers 1 Correct answer

Community Expert , May 16, 2021 May 16, 2021

Your condition in CustomerCountyCodes2dropdown are not set correctly, you used if selection is not "Select City" or if selection is "Select City" also you don't need to make variable for dropdown field, use "event.value".

You have  a lot of codes so you should also make sure that "Field calculation order" is set correctly.

Votes

Translate

Translate
Community Expert ,
May 16, 2021 May 16, 2021

Copy link to clipboard

Copied

Your condition in CustomerCountyCodes2dropdown are not set correctly, you used if selection is not "Select City" or if selection is "Select City" also you don't need to make variable for dropdown field, use "event.value".

You have  a lot of codes so you should also make sure that "Field calculation order" is set correctly.

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
Contributor ,
May 17, 2021 May 17, 2021

Copy link to clipboard

Copied

LATEST

Thank you Nesa for your guidance! I found this past post on the matter by try67 and will repost for anyone else confused about when to use event.value etc vs variables.

**To summarize, event.value represents the field's new value, while event.target.value represents the field's current value.

The former is not available all the time, only in the events that were triggered by the change of the field's value, like Validation, Calculation, Format and Keystroke. The other events are triggered by the user interacting with the field in some other ways (entering it, exiting it, clicking it, etc.), and not by changing its value, which is why event.value doesn't exist for them.

This can be a bit confusing for some types of fields, like radio-buttons and check-boxes, where clicking them does change their values, and then event.target.value can return either the new value or the old one, depending on at what triggered the event: Mouse Down will return the field's old value, while Mouse Up will return the new value, which was just applied to it by clicking it.

 

Knowing when to use either one is complicated and depends on your needs. You can read all about the event life-cycle and the meaning of the different types of events in the JavaScript for Acrobat API Reference, but the best way to learn it is through experience. **(*taken from 2017 post by try67)

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