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

Pull down menu option in Acrobat DC

New Here ,
Oct 27, 2017 Oct 27, 2017

I'm creating a form that will use pull down menus with basic choices to start. I will have the box checked to let the user enter custom text. Is there a way to have that custom entry automatically add itself to the existing pull down menu items so that it is available as an additional choice to the user the next time they fill that field out?

TOPICS
Acrobat SDK and JavaScript , Windows
387
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
Guide ,
Oct 29, 2017 Oct 29, 2017

I believe this can only be done through Scripting.

  • It's possible to set-up a dropdown menu so that someone can enter their own text. However this text is NOT automatically added to the dropdown menu options:
    dropdown-menu.png

I'm moving this post to the Scripting forum to see if someone else is able to answer this question for you.

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 ,
Oct 30, 2017 Oct 30, 2017
LATEST

Make sure to tick the "Allow user to enter custom text" box, as mentioned by Cari, as well as the "Commit select value immediately" box, (shown in the same screenshot), and then apply the following code as the field's custom validation script:

if (event.value) {

    var found = false;

    for (var i=0; i<event.target.numItems; i++) {

        if (event.value==event.target.getItemAt(i)) {

            found = true;

            break;

        }

    }

    if (!found) event.target.insertItemAt({nIdx: event.target.numItems, cName: event.value});

}

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