Copy link to clipboard
Copied
Hello,
I'm using Acrobat Reader DC,
I've the dropdown list ("dropdown1") with 3 options, for each option I did some coding, for example for option "system support"
if (this.getField("Dropdown1").value == "System Support") {app.alert("WELCOME KIT\n" + "Essential support agreement information",4, 0, "System Support");}
It works, BUT when I choose in dropdown list "system support" the code is triggered AFTER I click anywhere in the pdf (it's not done with the click and I need it to be excecuted when I choose that "System support" option).
In options of the dropdown list I've selected "commit selected value immidieatly" but I'm missing something...I tried some ideas in the internet like:
if(event.willCommit)
{
switch(event.value)
{
case "System Support":
{app.alert("WELCOME KIT\n" + "Essential support agreement information",4, 0, "System Support");};
break;
I believe I'm doing something wrong. Could you please help me?
Delete all other actions you added. Just use this one, as the custom validation script.
If it still doesn't work, share the file (via Dropbox, Google Drive, Adobe Cloud, etc.).
Copy link to clipboard
Copied
Use the Validation script and replace this part of your code:
this.getField("Dropdown1").value
With:
event.value
Copy link to clipboard
Copied
Hey,
I just tried:
if (event.value == "System Support") {app.alert("WELCOME KIT\n" + "Essential support agreement information",4, 0, "System Support");}
It's still working the same. I should also mention that in actions of that dropdown list, I've selected trigger "on blur", mainly because mouse up/down/enter/exit and on focus is not working with the dropdown list correctly.
Copy link to clipboard
Copied
Delete all other actions you added. Just use this one, as the custom validation script.
If it still doesn't work, share the file (via Dropbox, Google Drive, Adobe Cloud, etc.).
Copy link to clipboard
Copied
It works!
Thank you
So the problem was that I didn't put my code in custom validation script but within action !
Thanks a lot !