Hi,
I have this function that sort of works. It validates this field where I want users to type in a "dollar" amount.
function isMoney(elm) {
str = elm.replace("$", "");
str = str.replace(",",""); //regex=/^[a,b,c,x,y,z]{3}\d{3}$/;
var myexp = /^\d+\.\d{0,2}$/;
var regex = new RegExp(myexp);
return regex.test(str);
}
This works fine
$45.00
This does not
$45
Is there a way to have it so if the user enters just 34 it will add the .00 if it does NOT exist already.
My database has a column with a datatype of Money (using sql server).
Thanks
-ws
if not instring(blah,".") {
removespaces(blah)
blah = blah + ".00"
}