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

Java Script HELPPPPPPPPP

New Here ,
Sep 22, 2016 Sep 22, 2016

I need some help.  I have NO javascript experience and everything that it's in my form so far i've found on the internet.  Here's the situation...there's two drop down menus.  the first drop down menu has I, II, III as choices.  The next dropdown has 1, 2, and NA as choices.  I need a script that allows for the user to select from dropdown one either I or II and then auto populate NA in the next dropdown (refusing to select the other two choices).  If the user selects III in the first dropdown, i need the script to allow the user to select 1 or 2 in the next dropdown but NOT NA.  Make sense?  I'm just trying to make the form idiot-proof for the masses, ya know?

I'd really appreciate any help at all.  Also, if you know of any materials that could help me learn this stuff for Acrobat, i'd appreciate it.  This is a pretty powerful program and could see it becoming very valuable.

BTW, i'm using Acrobat XI Pro

Message was edited by: MICHAEL FRARACCIO

TOPICS
Acrobat SDK and JavaScript , Windows
588
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 , Sep 24, 2016 Sep 24, 2016

Use this code as the first field's custom validation script (make sure to tick the option to commit the selected value immediately, under Properties - Options):

if (event.value=="I" || event.value=="II") this.getField("Dropdown2").setItems(["N/A"]);

else if (event.value=="III") this.getField("Dropdown2").setItems(["1", "2"]);

else this.getField("Dropdown2").clearItems();

Translate
Community Expert ,
Sep 24, 2016 Sep 24, 2016

Use this code as the first field's custom validation script (make sure to tick the option to commit the selected value immediately, under Properties - Options):

if (event.value=="I" || event.value=="II") this.getField("Dropdown2").setItems(["N/A"]);

else if (event.value=="III") this.getField("Dropdown2").setItems(["1", "2"]);

else this.getField("Dropdown2").clearItems();

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
New Here ,
Sep 26, 2016 Sep 26, 2016
LATEST

That worked perfectly! Thanks so much!

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