Created
September 19, 2016 15:22
-
-
Save xto3na/9e99f2b4088c7b120a01e5d7e20bdad2 to your computer and use it in GitHub Desktop.
Select validation required
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select class="required day" name="profileInputId_29412"> | |
<option value="0">Выберите день *</option> | |
<option value="1">Пятница 19-22</option> | |
<option value="2">Суббота 19-22</option> | |
</select> | |
<script> | |
document.addEventListener("DOMContentLoaded", function(){ | |
$("#sub_form").validate({ | |
focusInvalid: false, | |
focusCleanup: true, | |
rules: { | |
profileInputId_29412: { | |
selectcheck: true | |
} | |
}, | |
messages: {} | |
}); | |
// Ввод только цифр | |
// $('.sum, .inn').keyup(function () { | |
// this.value = this.value.replace(/[^0-9\.]/g,''); | |
// }); | |
// Проверка выбора в select | |
jQuery.validator.addMethod('selectcheck', function (value) { | |
return (value != '0'); | |
}, "Нужно выбрать одно из значений"); | |
$(".sms").mask("+38(099)99-99-999"); | |
//$(".birthday").mask("дд: 99 / мм: 99 / гггг: 9999"); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment