contributte / live-form-validation

:no_entry: Nice client-side live form validation for Nette Forms.
https://contributte.org/packages/contributte/live-form-validation.html
BSD 3-Clause "New" or "Revised" License
59 stars 24 forks source link

Empty messages after hidden inputs #43

Open TomasA opened 6 years ago

TomasA commented 6 years ago

LiveForm generates a tag for message for hidden inputs even when I specify 'no-show-valid' and 'no-live-validation' class. Those tags are empty but have initial margin so it breaks my design.

Problem is in processServerErrors method where disabled classes are not checked. This function call method getMessageElement which create a tag for message. The processServerErrors method is called in Nette.initForm function.

My suggestion is as follows:

LiveForm.processServerErrors = function(el) {
    if (this.hasClass(el, this.options.disableLiveValidationClass))
        return;
f3l1x commented 6 years ago

Could you prepare PR?