The problem is:
iTextSharp.text.pdf.TextField does not contain a definition for
Posted on StackOverflow on Sep 20, 2013 by mikessu
What you're looking for is called an additional action. For instance: you have an entry action, defined using
PdfName.E and an exit action, defined by
PdfName.X. The entry action is triggered when the mouse enters the rectangle that defines the field; the exit action is triggered when the mouse exist the rectangle that defines the field.
In your code, you're skipping a step and that's probably why you didn't find the function you need:
PdfFormField ffield = field.GetTextField(); ffield.SetAdditionalActions(PdfName.E, PdfAction("app.alert('action!')")); writer.AddAnnotation(ffield);
This snippet will cause an alert to appear when the mouse enters the text field. Other options are
PdfName.K (keystroke by user),
PdfName.V (validate, because the value of the field has changed), etc.