Dear Robert:
Thanks for sending the JS file. It is working fine but there is a little
problem when an error occurs you click on the ok then it didn't take the
text box filed focus and the cursor position goes to either next text box or
either to the url. I tried several ways. Please check if you can fix it
then do let me know.
Regards,
Meraj
>From: "Hinojosa, Robert A" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: RE: DateCompare
>Date: Wed, 11 Jul 2001 10:43:37 -0400
>
>Here is a js function that the great michael dinowitz put together.
>
>HTH,
>
>Robert
>
>/*
> *******************************************
> Template Name: ValidateDate.js
> Date Written : 02/21/2001
> Author : Michael Dinowitz
> Custom Tags Used:
>
>Description of Template Functionality.
>
>Validates a date as being in the proper format and being in the proper
>range
>for a month.
>Allows both numbered and lettered months.
>Allows numbers with and without leading zeros
>
>Input is a form field that is formatted as:
> <input type="text" onChange="ValidateDate(this)">
>*/
>// use the popup value to say if the date popup should come up or not
>before/after an error in a date entry
>
>function ValidateDate(dDateField)
>{
> dFormat = new
>RegExp("^(0[1-9]|[1-9]|10|11|12|jan[.]?|january|feb[.]?|february|mar[.]?|mar
>ch|april|may|june|july|aug[.]?|august|sept[.]?|september|oct[.]?|october|nov
>[.]?|november|dec[.]?|december)[^A-Z0-9]?(0[1-9]|[1-9]|1[0-9]|2[0-9]|3[01])[
>^A-Z0-9]?(19[0-9][0-9]|20[0-9][0-9]|[0-9][0-9])$", "i");
> if (!dFormat.test(dDateField.value))
> {
> alert('Please re-enter date in month/day/year format');
> dDateField.focus();
> return false;
> }
>
> // Turn the dates that were entered into variables to be used in later
>tests
> dMonth=RegExp.$1;
> dDay=RegExp.$2;
> dYear=RegExp.$3;
>
> // Test the months that have a day range of 30
> smallmonths = new
>RegExp("4|6|9|11|04|06|09|apr[.]?|april|june|sept[.]?|september|nov[.]?|nove
>mber", "i");
> if (dDay > 30 && smallmonths.test(dMonth))
> {
> alert("Please enter a date that is allowed in the month you have
>selected");
> dDateField.focus();
> return false;
> }
> // Handle leapyears
> if((dMonth ==2) && ((dYear % 4 > 0 && dDay > 28) || (dYear % 100 == 0 &&
>dYear % 400 > 0 && dDay > 28) || (dDay > 29)))
> {
> alert("You have entered a day in February that is illegal. Please enter
>a
>proper day.");
> dDateField.focus();
> return false;
> }
> return true;
>}
>
>
>
>-----Original Message-----
>From: Meraj UlQamar [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, July 11, 2001 12:31 AM
>To: [EMAIL PROTECTED]
>Subject: Re: DateCompare
>
>
>Dear ALL:
>
>I want to check the date validity through JavaScript. How I can do that?
>If any code please send me or at least tell me the site.
>
>
>Regards,
>
>Meraj
>
>
> >From: "Brett Smith" <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: <[EMAIL PROTECTED]>
> >Subject: DateCompare
> >Date: Tue, 10 Jul 2001 00:04:27 -0500
> >
> >I am trying to get my cfif statement to do a date compare where only
>future
> >dates will output. Below is the code I am currently using but if a
> >calendar
> >event is today it will not show. Anyone have any ideas?
> >
> ><CFOUTPUT QUERY="calendarinfo">
> >
> ><CFIF #DateCompare(CalendarInfo.Date,Now())# GT -1>
> >
> >#DateFormat(date, "mmmm D, YYYY")#
> >
> ></CFIF>
> >
> ></CFOUTPUT>
> >
> >
> >
> >-------------------------------------------------------------------------
> >This email server is running an evaluation copy of the MailShield anti-
> >spam software. Please contact your email administrator if you have any
> >questions about this message. MailShield product info: www.mailshield.com
> >
> >-----------------------------------------------
> >To post, send email to [EMAIL PROTECTED]
> >To subscribe / unsubscribe: http://www.dfwcfug.org
>
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>
>-------------------------------------------------------------------------
>This email server is running an evaluation copy of the MailShield anti-
>spam software. Please contact your email administrator if you have any
>questions about this message. MailShield product info: www.mailshield.com
>
>-----------------------------------------------
>To post, send email to [EMAIL PROTECTED]
>To subscribe / unsubscribe: http://www.dfwcfug.org
>
>-------------------------------------------------------------------------
>This email server is running an evaluation copy of the MailShield anti-
>spam software. Please contact your email administrator if you have any
>questions about this message. MailShield product info: www.mailshield.com
>
>-----------------------------------------------
>To post, send email to [EMAIL PROTECTED]
>To subscribe / unsubscribe: http://www.dfwcfug.org
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org