JS to PDF forms in Acrobat

Please I need help,
In a pdf document, which I edit via Adobe Acrobat, I need to execute the following Javascript in the text field when I press Enter on the keyboard:

if (event.target.value == “OK”) {
event.target.value = “N / A”;
}
else {
event.target.value = “OK”;
}

Pressing the mouse works without problems (only these triggers are offered to me), and I wish I could execute it via the Enter key.

Thanks in advance for the answers,

Welcome there,

I am not too familiar with the tools you are using, but I would assume you need to attach an event listener to the button:

So, you would want to attach a keydown event listener to the button, and check if the key being pressed is the ENTER key.

Hope this helps

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.