Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I don't want to display error messages from ParsleyJS

Tags:

parsley.js

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!
like image 586
Rauldinho Avatar asked Aug 15 '13 15:08

Rauldinho


People also ask

How do I get rid of parsley error?

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.

What is Parsley in javascript?

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.

What is data parsley validate?

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.


1 Answers

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.

like image 193
moonwalker Avatar answered Oct 12 '22 13:10

moonwalker