guillaumepotier / Parsley.js

Validate your forms, frontend, without writing a single line of javascript
http://parsleyjs.org
MIT License
9.05k stars 1.32k forks source link

Parsley.js bug #1348

Closed bartollajos closed 3 years ago

bartollajos commented 3 years ago

Hello,

Could you help please in the following parsley.js issue?

It seems to be a Parsley bug: Parsley should remove the error container if there are no errors anymore.

https://stackoverflow.com/questions/65236237/parsley-validation-after-a-successful-input-validation-an-empty-element-is-rema

@marcandre Do you have any idea? There is a screenshot under the stackoverflow link above which explains the issue.

Thank you, Lui

bartollajos commented 3 years ago

@marcandre Thank you for answer on stackoverflow. I would need a jquery script which will remove the .parsley-errors-list when the input is succeeded. It seems otherwise it is remined there. Although i used .filled class in CSS.

https://stackoverflow.com/questions/65236237/parsley-validation-after-a-successful-input-validation-an-empty-element-is-rema

bartollajos commented 3 years ago

@marcandre it seems this script does the trick. Maybe it is ugly but works:

$('#contactForm').parsley().on('field:success', function() { 
    $('ul.parsley-errors-list').not(':has(li)').remove();
});
marcandre commented 3 years ago

Great :-)