I come through a way to validate amount field.
This script validates amount field.
- If the value have a dot, It must be preceded and followed by one or two numerals.
var val = /^-?\d+(\.\d+)?$/.test(document.frm.txt_amount.value);
if(!val)
{
alert("Please enter correct amount.");
return false;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment