I'd use JavaScript to do this.
Something along the lines of
function isValid(theForm) {
if (theForm.number.value.length != 10)
{
alert("Your date must be in the format YYYY-MM-DD");
}
}
<form name=theForm>
<input name=number>
<input type=submit onclick=isValid(theForm)>
</form>
If this doesn't work there are plenty of tutorials on the web for this. Just search for JavaScript form validation.