N
N
Nikita Shchypylov2016-08-10 16:40:00
JavaScript
Nikita Shchypylov, 2016-08-10 16:40:00

Why does the validator give an error when everything is correct?

Hello everyone
. This question: I have a form on the site with a phone number, message, email and name
The form is not sent, because the phone is always wrong, I can not understand why.
And so, html:

<div class="input-wrap f_left">
            <input type="text" name="number" class="number" placeholder="Телефон">
          </div>


Connected standard validator and mask.
validator:
rules: {
      'number': {
        required: true,
        characters: true
      }
    }
    //Specify the validation error messages
    messages: {
      'number': {
        required: "Введите номер",
        characters: "Введите номер"
      }
    }


Well, the mask:

$('.number').mask("+38(099) 999-99-99");

When I fill out the form, it doesn’t visually give an error, it doesn’t write in red, but there is an error in the inspector (a label with an error appears, aria-invalid="true"aria-required="true"

I would be grateful for advice

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question