Copy link to clipboard
Copied
I've written a simple script, but cannot seems to figure out why am I experiencing a delay in the toggle of the message.
I have a textbox that sum's up values selected on 3 drop down lists. All have been formatted as numbers. The sum works just fine.
I have another textbox that stores the above total and I have added a script to display a message if the value if greater than 100 or less than 100.
The message displays after a lag. For example, if the total selected is greater than 100 and i use the dropdown to select that now makes the value less than 100, the message does not switch unless i make a second change on the drop down.
here is the code:
if (this.getField("Text2").value < 100) {
this.getField("message1").display = display.visible;
this.getField("message2").display = display.hidden; }
if (this.getField("Text2").value > 100) {
this.getField("message2").display = display.visible;
this.getField("message1").display = display.hidden; }
I guess i am missing some kind of event trigger when the drop down is changed. I tried to place the script on the dropdowns as well, but no luck.
help is much appreciated!
[Title edited by moderator to include “Acrobat”. Adobe is the company; Acrobat is the software.]
Move it back to the Validation event, and change all instances of this:
this.getField("Text2").value
To:
event.value
Copy link to clipboard
Copied
Please post the name of the program you use so a Moderator may move this message to that forum
-A program would be Dreamweaver or Muse or Acrobat or ???
Copy link to clipboard
Copied
The program I am using is Adobe Acrobat XI Pro
Copy link to clipboard
Copied
I‘ve moved this from Adobe Creative Cloud to PDF Forms.
~ Jane
Copy link to clipboard
Copied
Where did you place the code?
Copy link to clipboard
Copied
I tried placing the code on the "Text2" textbox that holds the sum on the 'validate' tab > run a custom validation script.
I also tried placing the code under the 'Actions' tab and set multiple triggers: mouse up/down/exit and run a javascript, that didnt work too.
Copy link to clipboard
Copied
Move it back to the Validation event, and change all instances of this:
this.getField("Text2").value
To:
event.value
Copy link to clipboard
Copied
thank you try67! That definitely helped to fix my issue. I appreciate your help!