How to add an onMouseOver javaScript action to a TextField?

How can I add javascripts to iTextsharp created textfields? I've tried following: TextField field = new iTextSharp.text.pdf.TextField(writer, new iTextSharp.text.Rectangle(x, y - h, x + w, y),

How can I add javascripts to iTextsharp created textfields? I've tried following:

TextField field = new iTextSharp.text.pdf.TextField(writer,
    new iTextSharp.text.Rectangle(x, y - h, x + w, y), name);
field.BackgroundColor =
    new BaseColor(bgcolor[0], bgcolor[1], bgcolor[2]);
field.BorderColor =
    new BaseColor(bordercolor[0], bordercolor[1], bordercolor[2]);
field.BorderWidth = border;
field.BorderStyle = PdfBorderDictionary.STYLE_SOLID;
field.Text = text;
// PROBLEM:
// field.AddJavaScript = PdfAction.JavaScript(
// "this.getField(\"Total_0\"").value = ( this.getField(\""Quantity_0\"").value


Ready to use iText?

Try our iText 7 Library and add-ons FREE for 30 days. Test your proof of concept, and see if our solution is right for you.

Get my FREE trial
Contact

Still have questions? 

We're happy to answer your questions. Reach out to us and we'll get back to you shortly.

Contact us
Stay updated

Join 11,000+ subscribers and become an iText PDF expert by staying up to date with our new products, updates, tips, technical solutions and happenings.

Subscribe Now