You can add this IF statement to any javascript function and change it as needed. This will validate whether a field is only numbers.
if(isNaN(myForm.txt_myField.value))
{
alert("Invalid data format.\n\nOnly numbers are allowed.");
myForm.txt_myField.focus();
return (false);
}
Comments