i'm using ParsleyJS library to validate my form, but if a field is invalid i only want to apply the error classes but i don't want to display the error messages. If i use the property data-show-errors="false
, then neither the class or the error shows. I used this method of putting display:none
in the css:
ul.parsley-error-list { display:none !important; } ul.parsley-error-list li { display:none !important; }and it works, but i wanted to know if this is the right approach for doing this or if the library has a way to configure it? Thanks!
The way to customize the error message shown is using "data-parsley-error-message" , so the "hack" is to provide an empty custom message. As more than a year has passed, and there are no "accepted" answers in the thread, at least, this code works.
Parsley is a javascript form validation library. The purpose of ParselyJS is to validate form values before sending it to the webserver. Parsely provides client-side/front-end validation and it does not replace backend server validation.
Frontend form validation Parsley is a javascript form validation library. It helps you provide your users with feedback on their form submission before sending it to your server. It saves you bandwidth, server load and it saves time for your users.
As of version 2.0+ you can disable the error messages with adding:
data-parsley-errors-messages-disabled
attribute to your form input elements. This won't disable the red color marking of the inputs though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With