There is a condition:
if (!phone || phone.replace(/\D/g, '').length < 12) enable = false; if (codes[phone.substr(5, 3)]) valid = true; Markup:
<form> <div class="column"> <div class="form-group"> <input type="text" class="form-control" placeholder="Ваш телефон" name="phone" data-mask="+38 (099) 999-99-99" required/> </div> </div> <div class="column"> <div class="form-controls"> <button type="button" class="btn btn-red btn-large btn-block btn-submit" required disabled="disabled">Заказать звонок</button> </div> </div> </form> How can I display the message “incorrect input” in the input, in case of non-observance of these conditions?
Here is the full code: jsfiddle.net/0xL0fctq/31