On Wed, 2006-02-01 at 21:04 +0100, Udo Rader wrote: > 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.
to answer my question myself once more: the first parameter of the js setAction method should not be "Validate" but "Keystroke" instead. ... sorry for the noise. Udo Rader -- BestSolution.at EDV Systemhaus GmbH http://www.bestsolution.at
signature.asc
Description: This is a digitally signed message part
