Hello all. I have a form with a text field that expects the users to enter a currency value.
I would like the field to contain NO COMMA's - as it messes up the query_string that is submited by the form. I tried:
and the specific textfield code:
but if the form doesnt validate all fields, it reverts back with the commas in this field.
the format function makes sure the user enters more than 2 numbers after the decimal. Now want to make sure a number such as:
12,234.88 goes to the query_string as 12234.88
Using Dreamweaver 8.
Any ideas? all help is appreciated!
cmcc
I would like the field to contain NO COMMA's - as it messes up the query_string that is submited by the form. I tried:
Code:
function removeCommas(str) {
return str.replace(/,/g, "");
}
and the specific textfield code:
Code:
<input name="amount" id="amount"
size="35" onkeyup="removeCommas(this);format(this);" onchange="removeCommas(this);format(this);"/>
but if the form doesnt validate all fields, it reverts back with the commas in this field.
the format function makes sure the user enters more than 2 numbers after the decimal. Now want to make sure a number such as:
12,234.88 goes to the query_string as 12234.88
Using Dreamweaver 8.
Any ideas? all help is appreciated!
cmcc