Hi I'm using parsleyjs for my form validation.
http://parsleyjs.org/documentation.html
I want a custom validator so that an input value can not equal what I specify...
An example using jQuery validation can be seen here... How to add a Not Equal To rule in jQuery.validation
I'm thinking something like..
$( '#form' ).parsley( {
validators: {
notEqual: function ( val, ??? ) {
return val != ??? ;
}
}
, messages: {
notEqual: "Please enter a valid value"
}
} );
Thanks
This worked for me. You also have to set
data-notEqual="#element"
.Hope this is what you are looking for!