Skip to content

Validator displays a blank error message on keyup and blur #373

Closed
@carlos-max

Description

@carlos-max

The validator displays a blank error:

  • 1: After filling a required field and changing focus to another field (Using tab key or clicking);
  • 2: On keyup, when the validator already displayed a validation error message;

1:
1

2:
2

The HTML:

<body>
<p id="error-msg">

        <form id="form-cliente" class="tabs" method="post" action="php/cliente_cadastro.php">

        <input type="text" id="cnpj" name="cnpj"  data-validation="required" data-validation-error-msg="O campo CNPJ é obrigatório!">

The script:

$(document).ready(function() {
.....
            var $messages = $('#error-msg');

            $.validate({
                form : '#form-cliente',
                modules: 'html5',                                              
                validateOnBlur : true,                
                showHelpOnFocus : false,
                addSuggestions : false,
                errorMessagePosition : $messages,
                scrollToTopOnError : true,
            });
});

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions