I am using the latest version of ParsleyJS and tried the example from doc, just copy pasted it into my code but it wont work. I actually made my own validator but its not working, so I tried to copy paste the exact example but it doesn't work as well.
I am working with Laravel and here's my form and js code.
<div class="form-group">
<label>Name of my school</label>
{{ Form::text('edu[institute]', null, ['class' => 'form-control', 'data-parsley-myValidator' => '']) }}
</div>
window.Parsley.addValidator('myValidator', {
validateString: function(value) {
return value.split('').reverse().join('') === value;
},
messages: {
en: 'This string is not the reverse of itself',
fr: "Cette valeur n'est pas l'inverse d'elle même."
}
})
I have just torn my hair, WHY WOULD THIS NOT WORK?
Laravel blade output of form field:
<input class="form-control" data-parsley-myvalidator="" name="edu[institute]" type="text">
EDIT: This form field is inside a Bootstrap Modal.