I have some input fields in a page and i want to validate if they contain currency values such as $100 or with euro.
Any one have an idea or example?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
a regex can validate that for you:
(but with the euro sign in there too)
this one I’ve given won’t be the most robust way to do it. You could alter to your preference. An alternative is to try something like this:
It strips away any non-number or
.characters from the start and then parses it as a float.