Skip to main content
Participating Frequently
February 12, 2019
Question

Using JavaScripts to handle keypress events

  • February 12, 2019
  • 1 reply
  • 3742 views

I am converting a HTML file into PDF using evoPDF library in a c# application. This PDF form has multiple textboxes and my requirement is to track keypress event or blur event for these textboxes. I am not able to find syntax on how to write these event  handling in Adobe JavaScript. Can someone guide me with these. Your help will be highly appreciated.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
February 12, 2019

You can use the setAction method to apply a script to the Keystroke and OnBlur events of the fields.

Participating Frequently
February 12, 2019

can you please guide me with the syntax to use it,

I am currently trying this:

pdfDocument.Form.Fields["txt_BorrowerHireDate"].Action = new PdfActionJavaScript("if(this.getField('txt_BorrowerHireDate').keyDown==true){app.alert('test');}");

try67
Community Expert
Community Expert
February 12, 2019

Sorry, I'm not familiar with the syntax of your C# library.