validation via javascript
- From: Udo Rader <udo.rader (at) bestsolution.at>
- Date: Wed, 01 Feb 2006 21:04:56 +0100
Hi,
I'd like to test the values of certain acroform fields using the AR built
in validation methods, such as AFDate_KeystrokeEx( someDateFormat ).
What I've learned so far from reading Adobe's JS guide is that one has to
do this on the _javascript_ level.
So here's what I do:
-----------CUT----------
PdfFormField field = pdfWriter_.getAcroForm().addSingleLineTextField( fieldname, content, base_font, font_size, llx, lly, urx, urx );
String datechecker = "this.getField(\""+fieldname+"\").setAction( \"Validate\", \"AFDate_KeystrokeEx( 'dd-mmm-yyyy' )\" ) ;\r";
PdfAction validator = PdfAction._javascript_( datechecker, pdfWriter_ );
field.setAction( validator);
-----------CUT----------
Yet the field is actually never validated, obviously the AFDate_KeystrokeEx method is never called.
... where am I wrong here?
TIA
Udo Rader
Attachment:
signature.asc
Description: This is a digitally signed message part