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

The selection changes when using dropdown in a PDF form.

Participant ,
Aug 14, 2017 Aug 14, 2017

I'm still learning JS.  I would like to have a dropdown menu in a PDF form where the user selects from the dropdown but when he clicks on it, a different output occurs.  Example, user selects "G2 - Security" in the dropdown but "ARNO-G2" is what's displayed on the form.  Is this possible?

TOPICS
Acrobat SDK and JavaScript , Windows
594
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

correct answers 1 Correct answer

Community Expert , Aug 14, 2017 Aug 14, 2017

Yes, but why would you want to do that? It's really confusing...

The way to do it is by using a custom Format script to change the selected value into something else. In your case it would be:

if (event.value=="G2 - Security") event.value = "ARNO-G2";

Translate
Community Expert ,
Aug 14, 2017 Aug 14, 2017

Yes, but why would you want to do that? It's really confusing...

The way to do it is by using a custom Format script to change the selected value into something else. In your case it would be:

if (event.value=="G2 - Security") event.value = "ARNO-G2";

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
Participant ,
Aug 14, 2017 Aug 14, 2017

try67,

It isn't really confusing because we have a form that we have to input the Office Symbol and we don't have all of them memorized.  So when a user in-processes with us, they'll know what directorate they're going to before they know what the Office Symbol is and then I have to look it up and input the Office Symbol that matches the directorate.  It would be easier for them to select the directorate and then the Office Symbol is the output in the window.  However, I just tried that script and nothing happened.  I selected G2 - Security in the dropdown menu and instead of displaying ARNO-G2, it displayed what I selected...G2 - Security.

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 ,
Aug 15, 2017 Aug 15, 2017

Make sure you tick the option to commit the field's selected value immediately, under its Properties - Options tab.

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
Participant ,
Aug 17, 2017 Aug 17, 2017
LATEST

try67​ It's working sir!  Thank you.  the problem I had was not paying "attention to detail".  You stated in the original comment to use a Custom Format Script and I was putting the script in the Run custom validation script window.

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