deziner76hd
05-06-2012, 12:02 AM
Hello,
I would like to have a specific date range in years entered into a text box and if anything else is entered a pop up alert would appear. The date range would be from 1912 to 2002. Any help with this would be greatly appreciated.
This is the Javascript I am trying to use:
<script type="text/javascript">
function checkDate(theForm)
year=document.getElementById('YearBorn').value;
if(year<1912 || year>2002)
{
alert("registration is restricted to those born between 1912 to 2002");
return false;
else {
return true;
}
}
</script>
I have included this code in the Additional Attributes:
onblur="return checkDate(this);"
I would like to have a specific date range in years entered into a text box and if anything else is entered a pop up alert would appear. The date range would be from 1912 to 2002. Any help with this would be greatly appreciated.
This is the Javascript I am trying to use:
<script type="text/javascript">
function checkDate(theForm)
year=document.getElementById('YearBorn').value;
if(year<1912 || year>2002)
{
alert("registration is restricted to those born between 1912 to 2002");
return false;
else {
return true;
}
}
</script>
I have included this code in the Additional Attributes:
onblur="return checkDate(this);"