Hi all,
I have this code that only allows a period and numbers to be put in the text box. The problem is that the message also appears if the text box is left blank. I don’t want the error to appear if the text box is left blank. Right now I have it on a Blur so that the error message appears when the person clicks outside of the text box. Any help would be great.
Thanks,
Cedric
<script language=javascript>
function checkNumeric(value)
{
var anum=/(^d+$)|(^d+.
if (anum.test(value))
return true;
alert(“You can only input a period(.) and numbers(0-9) in this text box. Also, do not enter a dollar sign($) as this will automatically be added to your price.”);
return false;
}
</script>