0

I'm using jQuery validate plugin and I need to validate price (ie. digits and one dot). I tried to add digits: true and the form accepts only numbers, but I don't know how to do the same thing with a dot.

$('#form').validate({ 
    rules: {
        buy_1: {  
            required: true,
            digits: true
        }

I already try it without success how to validate for money in jquery

Community
  • 1
  • 1
Sarah
  • 15
  • 7
  • I already try it without success http://stackoverflow.com/questions/21017867/how-to-validate-for-money-in-jquery – Sarah Jun 08 '16 at 11:15
  • 1
    hey there. unless you can explain how exactly you "tried without success" your question will remain a duplicate. We have no cue if you even tried it in the right way or what. Explain what you tried, why it is exactly the same as the other answer, and how it still doesn't work please. – Félix Adriyel Gagnon-Grenier Jun 08 '16 at 12:46
  • There is a rule called `currency` included within t[he `additional-methods.js` file](https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.15.0/additional-methods.js). Otherwise, you'll have to use `.addMethod()` to write your own custom rule. – Sparky Jun 08 '16 at 14:19

0 Answers0