PDA

View Full Version : Removing Commas


jntcomputers
06-30-2005, 02:18 AM
I have a form that runs from a php code. It doesn't except commas in the numbers. How can I remove the commas?

Harry Armadillo
06-30-2005, 02:41 AM
More details needed, plus the code you currently have.

jntcomputers
07-01-2005, 03:49 AM
Basically, I have forms that the user can enter values (monetary) into the fields. One form script will give a $NaN value/error. This one is a javascript calculator. I will post it if neccessary.

The other is an input form that record member data & listing values. This paticular one is the input for the home value... if a comma is put in (e.g. 175,000) it records 175.00 into the database.

Let me know if you need the code and I will dig it up. I really just need a javascript that I can use to remove commas onBlur or similar!

Harry Armadillo
07-01-2005, 04:06 AM
onblur="this.value=this.value.replace(/,/g,'')"

jntcomputers
07-01-2005, 01:15 PM
Simple enough! Thanks a bunch!