PDF-Forms is a service provided by PDFzone.com | http://www.pdfzone.com/
__________________________________________________________________

Look at the scand Util method. It tries to create a date object from a text
string. Once you get a date object you can change it to whatever format you
like.
The main hassle with what you are trying to do is that this method requires
you to specify the expected format. So, you may have to iterate through a
bunch of formats to find what the user tried to use.
The other way to do this is to parse the string yourself and use the
standard javascript date methods to manipulate the results. It's certainly
much more complicated.


Rob Cairns
Senior Technical Specialist - I & C Computers
Safety Related Computers
Computers and Control Design Department 
Ontario Power Generation Incorporated
H12 G27
Phone:  (416) 592-5500     fax: (416) 592-8802
e-mail: [EMAIL PROTECTED] 




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of McDowell, Carol
Sent: Monday, 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




--------------------------------------------------------------
THIS MESSAGE IS ONLY INTENDED FOR THE USE OF THE INTENDED RECIPIENT(S) AND MAY CONTAIN 
INFORMATION THAT IS PRIVILEGED, PROPRIETARY AND/OR CONFIDENTIAL.  If you are not the 
intended recipient, you are hereby notified that any review, retransmission, 
dissemination, distribution, copying, conversion to hard copy or other use of this 
communication is strictly prohibited.  If you are not the intended recipient and have 
received this message in error, please notify me by return e-mail and delete this 
message from your system.  Ontario Power Generation Inc.

To change your subscription:
http://www.pdfzone.com/discussions/lists-pdfforms.html

Reply via email to