// wait for the DOM to be loaded jQuery(document).ready(function($) { var formZakazatZvonok = { beforeSubmit: validateFormZakazatZvonok, clearForm: true, }; $('#form-call-request').ajaxForm(formZakazatZvonok); function validateFormZakazatZvonok(formData, jqForm, formZakazatZvonok) { var nameFormZakazatZvonok = $('#form-call-request input[name=introduce_name]').fieldValue(); var telephoneFormZakazatZvonok = $('#form-call-request input[name=introduce_phone]').fieldValue(); if (!nameFormZakazatZvonok[0] || !telephoneFormZakazatZvonok[0]) { $('#form-call-request input[name=introduce_name]').css('border-bottom', '1px solid rgba(255, 0, 0, 0.38)'); $('#form-call-request input[name=introduce_phone]').css('border-bottom', '1px solid rgba(255, 0, 0, 0.38)'); return false; } $('#block-call-request .title').html('Спасибо!'); $('#block-call-request .text').html('Наши консультанты свяжутся с Вами в ближайшее время.'); $('#block-call-request form').html(' '); } }); jQuery(function($){ $.mask={definitions:{x:"[1-9]","9":"[0-9]",a:"[A-Za-zа-яА-Я]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn",placeholder:"_"}; $("#form-call-request input[name=introduce_phone]").mask("+7 (x99) 999-99-99"); //e.mask={definitions:{x:"[1-9]","9":"[0-9]",a:"[A-Za-zа-яА-Я]","*":"[A-Za-z0-9]"},dataName:"rawMaskFn",placeholder:"_"}; });