# Need help on validation mm/dd/yyyy in Javascript

**URL:** <https://forum.kirupa.com/t/need-help-on-validation-mm-dd-yyyy-in-javascript/225945>\
**Category:** web dev\
**Created:** [May 16, 2007, 11:08pm UTC](https://forum.kirupa.com/t/need-help-on-validation-mm-dd-yyyy-in-javascript/225945 "2007-05-16T23:08:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GEE\_Q](https://avatars.discourse-cdn.com/v4/letter/g/8baadc/32.png) [@GEE\_Q](https://forum.kirupa.com/u/GEE_Q)\
**Post date:** [May 16, 2007, 11:08pm UTC](https://forum.kirupa.com/t/need-help-on-validation-mm-dd-yyyy-in-javascript/225945/1 "2007-05-16T23:08:38Z")

</div>

Hey Whats up,  
I am working on a form and I am trying to get the date to validate using mm/dd/yyyy , so the user has to type the date in like that or they will not be able to submit the form…this is what I have so far, i need help, i am sort of new to javascript so if you could help me figure this out it would be greatly appreciated…i think i need an array but i am super confused. i am trying to add this below to an if statement that is part off the validator i am using

move is the field name - here is the if statement i would like it to work with - please help !!! as you can see it is only validating 2 and / !!!

if ((document.account\_edit.move.value == “”) ||  
(document.account\_edit.move.value.indexOf(‘2’) == -1) ||  
(document.account\_edit.move.value.indexOf(’/’) == -1)) {  
missinginfo += "  
- When are you moving? mm/dd/yyyy format";  
}
