Skip to main content
Inspiring
August 14, 2017
Answered

The selection changes when using dropdown in a PDF form.

  • August 14, 2017
  • 1 reply
  • 678 views

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?

This topic has been closed for replies.
Correct answer try67

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";

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 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";

SIPRNet11Author
Inspiring
August 15, 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.

try67
Community Expert
Community Expert
August 15, 2017

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