javascript date validation (length 2 digit month, day, 4 digit year)
<p>Here is the date validation I am currently using, it works, but I want to make sure 2 digits are entered for month and 2 for Day. I am not too familiar with javascript, and getting this far took lots of searching on here. Any help would be appreciated. Thanks</p>

<pre><code> function validate_birthday(field,alerttxt)
 {  
 with (field)
 {
 dateParts = value.split('-');
 if(dateParts.length != 3) {
 alert('Date Format Must Be MM-DD-YYYY');
 return false; }
  testDate = new Date(dateParts[2] + '/' + dateParts[1] + '/' + dateParts[0]);  

if(isNaN(testDate.getDate())) {     alert('Date Format Must Be MM-DD-YYYY');     return false; 

 } 
 else {return true;}
}
}
</code></pre>
