<script type="text/javascript">
function validateDate(input)
{
//Basic check for format validity
var validformat=/^\d{1,2}\/\d{1,2}\/\d{4}$/
if (!validformat.test(input.value))
{
alert('Enter the correct Date Format');
input.value="";
return false ;
}
}
onkeypress="return DateValidations();"
function DateValidations(evt) {
var e = event || evt; // for trans-browser compatibility
var charCode = e.which || e.keyCode;
if (charCode > 31 && (charCode < 47 || charCode > 57))
{
return false;
}
else{
return true;
}
}
function validateDate(input)
{
//Basic check for format validity
var validformat=/^\d{1,2}\/\d{1,2}\/\d{4}$/
if (!validformat.test(input.value))
{
alert('Enter the correct Date Format');
input.value="";
return false ;
}
}
onkeypress="return DateValidations();"
function DateValidations(evt) {
var e = event || evt; // for trans-browser compatibility
var charCode = e.which || e.keyCode;
if (charCode > 31 && (charCode < 47 || charCode > 57))
{
return false;
}
else{
return true;
}
}
</script>
In Code Behind:
onchange="return validateDate(this);"
In Code Behind:
onchange="return validateDate(this);"
No comments:
Post a Comment