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

This works for me!  Thanks so much for your help.

-----Original Message-----
From: J Bealer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 30, 2004 8:27 AM
To: [EMAIL PROTECTED]
Subject: RE: [PDF-Forms] Need Custom Calculation Script to format date



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

Carol,
Using Acrobat's own date validation, you could try something like this, 
substituting your own alerts, in the Custom Validate script of your date 
field :

if(event.value)
{
        var DateOK = AFParseDateEx(event.value,"mm/dd/yyyy");
        if(DateOK != null)
        {
                app.alert("date ok");
                event.value = util.printd("mm/dd/yyyy", DateOK);
        }
        else
        {
                event.value = "";
                        app.alert("date not ok");
        }
}




>From: "McDowell, Carol" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: [PDF-Forms] Need Custom Calculation Script to format date
>Date: Mon, 29 Mar 2004 11:16:42 -0500
>
>
>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
>

_________________________________________________________________
Get rid of annoying pop-up ads with the new MSN Toolbar - FREE! 
http://toolbar.msn.com/go/onm00200414ave/direct/01/


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

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

Reply via email to