Parsley for validations?


Has anybody here used ParsleyJS library for validations? Just curious if it possible, and if so are there any examples I can take a look at?

Im trying to generate dynamic forms from a JSON object passed through and nothing eles seems to be doing the trick.


nvm, I answered my own question. You have to use class="parselyjs in the form element.

Now I still have another question. How can I generate dynamic html validations, ie. <ion-input data-parsley-max="{{q.validatorMax}}" ></ion-input>?

edit: For quotes around “{{}}”

Edit 2: I got the parsley validation to work, but when I want to dynamically insert a validation stored in a JSON string, that doesnt seem to function properly. I can hack a bit of it by using []={{q.minValue}} . That however only inserts the min value into the tag and not the tag which is the one the HTML is going to validate.

Oh well, I guess Parsley wont do for dynamic validations…