This content has been marked as final. Show 4 replies
To check for three date formats, one correct formats and two for conversion, you'll need to first write Regular Expressions for all three. After this it's a matter of figuring out if the input matches any of these and then applying the appropiate action, either converting, complianing, or doing nothing. All of this can be done from the validate event.
As an alternative, you could use the keystroke event to limit the kinds of input the user can type into the field in the first place.
Here are some articles that are relavant to your task:
You'll also find detailed tutorials on using the Validate and Keystroke events at www.pdfscripting.com
The source for PDF Scripting Info
thank you very much, i'll work with all the info you have given me and hopefully be able to get some results.
think I may have come across something that will work,
going to require the user to input the date with / and then use the split() methoid in order to populate an array. in the array I can edit and alter stuff. Thanks for the leads, it was a lot of good information that got me back into the coding mindset.
Actually your best strategy for a simple format check is to use a regular expression. This is a very powerful method of text pattern matching.
However, you could also check the dates by trying to read them into a date object with the "util.scand()" function. Then use the date object to print out the date in the format you want.