Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 20th, 2013, 04:19 PM
Registered User
 
Join Date: Sep 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Smile How to validate date field completely in an html form.

future date and months having 30 and 31 days.and february validation too.
 
Old March 20th, 2013, 05:35 PM
Authorized User
 
Join Date: Jun 2012
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Default

You may want to use an array with the number of days for each month. Each month is numbered 0 -11 (January is 0 and December is 11), so your array might look like this:

months[0] = 31; // January
months[1] = 28; // February; if not a leap year
months[2] = 31; // March
months[3] = 30; // April

...and so forth. Hope this helps.





Similar Threads
Thread Thread Starter Forum Replies Last Post
access html form field in xsl medSwa XSLT 1 October 15th, 2011 10:41 AM
Form doesn't w3c validate, html 4.01 mps2006 HTML Code Clinic 1 November 26th, 2006 03:41 AM
maximum size of HTML form field crmpicco HTML Code Clinic 4 April 24th, 2006 05:14 AM
Validate a Text Field zaeem VB Databases Basics 0 May 20th, 2005 01:58 AM
Validate calculated field in sub form MG76 Access 4 March 18th, 2004 04:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.