Hi,
In Javascript, I am testing the value entered into a donation amount box on a form.
I want to make sure that the user enters a donation amount in the box greater than 1. So I am using this if statement: "If ( amountbox > 1 ) ..."
The problem is if a user enters "$.05" in the box, then this value tests higher than 1 because of the $ sign, and then this amount passes to the credit card processor's system, where we get charged $.40 for the transaction.
Is there a simple solution to this problem? Perhaps a way to only accept numeric input in a form's field?
Thanks.
In Javascript, I am testing the value entered into a donation amount box on a form.
I want to make sure that the user enters a donation amount in the box greater than 1. So I am using this if statement: "If ( amountbox > 1 ) ..."
The problem is if a user enters "$.05" in the box, then this value tests higher than 1 because of the $ sign, and then this amount passes to the credit card processor's system, where we get charged $.40 for the transaction.
Is there a simple solution to this problem? Perhaps a way to only accept numeric input in a form's field?
Thanks.