Validations
Javascript validation
check numbers only.
function onlyNumbers(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))
{
alert('Please enter numeric values.');
return false;
}
else
{
return true;
}
}
Check character and space also .
function checkChar() {
if ((event.keyCode > 64 && event.keyCode < 91) || (event.keyCode > 96 && event.keyCode < 123) || event.keyCode == 8 || event.keyCode==32)
return true;
else {
alert("Please enter only character.");
return false;
}
}