Reputation: 2478
I am trying to use Parsley.js for validate some form fields. After read the docs and see how I should use it I follow the next steps:
data-validate
to form <form action="" id="product_create" method="post" data-validate="parsley">
<input type="text" id="product_price" name="product[price]" data-trigger="change keyup keypress" data-required="true" data-type="number">
If I don't understand bad so when I change the value of #product_price
error should appears right? Well it doesn't and I can't find why or how I'm doing wrong, any advice
Upvotes: 0
Views: 4566
Reputation: 2000
For me, this error came from setting one of my input values to value='', which I know many people use. I found a workaround from that and it worked as it should.
Upvotes: 0
Reputation: 11
I had the same problem and I solved it with data-validation-minlength="0"
Upvotes: 1
Reputation: 7540
I assume the issue is that you've entered some invalid value and expected parsley to come up with an error-msg when you left the field?
I'm currently struggling with that, too - and it seems to be that way "by design": https://github.com/guillaumepotier/Parsley.js/issues/262 Also the "classy demo" on http://parsleyjs.org/documentation.html does not validate when you immediately enter invalid data, it only does so when you try to send the form.
Anyway, I have opened an issue on https://github.com/guillaumepotier/Parsley.js/issues/385 and hope to understand the problem a bit better and maybe even get that changed ;-)
Upvotes: 1