I don't want to display error messages from ParsleyJS
Asked Answered
I

2

8

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!
Immunity answered 15/8, 2013 at 15:19 Comment(0)
H
3

No you're right, there is currently no support for this kind of option, and it would be nice to provide it natively in config.

I'll look into it, or feel free to add it and submit a PR.

Thanks

Howsoever answered 16/8, 2013 at 10:22 Comment(1)
Thanks for your answer. I submit the PR. And thanks for your work in the library, it's excellent!Immunity
G
13

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.

Guelders answered 17/3, 2017 at 13:14 Comment(0)
H
3

No you're right, there is currently no support for this kind of option, and it would be nice to provide it natively in config.

I'll look into it, or feel free to add it and submit a PR.

Thanks

Howsoever answered 16/8, 2013 at 10:22 Comment(1)
Thanks for your answer. I submit the PR. And thanks for your work in the library, it's excellent!Immunity

© 2022 - 2024 — McMap. All rights reserved.