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;
}
Showing posts with label Regex. Show all posts
Showing posts with label Regex. Show all posts
Friday, October 3, 2008
Subscribe to:
Posts (Atom)