PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/ __________________________________________________________________
Perhaps it would be easier to break up your single date field into three separate fields (Day, Month, Year). This makes it much easier to control the actual entry and, should you still require it, would allow you to simply build a string formatted the way you want. Said string could then be placed into a field. You could use JavaScript to switch a field's hidden/visible state to accomplish this (first hide the single field and show the three fields, then after the last field (year) has been completed, run the script that will set these three to hidden, populate your date string into the single field, and set it to visible.) This may be a safer alternative than trying to re-write Adobe's date function all over again. Maybe not. Mark -----Original Message----- From: McDowell, Carol [mailto:[EMAIL PROTECTED] Sent: March 29, 2004 11:17 AM To: '[EMAIL PROTECTED]' Subject: [PDF-Forms] Need Custom Calculation Script to format date PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/ __________________________________________________________________ I'm a beginner with using javascript in forms. I'd appreciate help with the following problem: I have a date field where the user will type in a date value. I want to use a custom calculation script where no matter what the user types in for the date, it will reformat it to mm/dd/yyyy. For example, if the user types "03/29/04" or "March 29, 2004", I want the value to change to "03/29/2004" automatically. I don't want to use the format field category because when the user doesn't type the date with this format, an invalid date/time warning pops up that says to make sure the date/time exists and that the format should match the format mm/dd/yyyy. I'd rather write my own warning in the custom calculation script if the user types in anything other than a date. Thanks. To change your subscription: http://www.pdfzone.com/discussions/lists-pdfforms.html To change your subscription: http://www.pdfzone.com/discussions/lists-pdfforms.html
