added validation for maxLength

This commit is contained in:
Jon Lambson 2017-07-11 16:09:42 -06:00
parent e748d8f849
commit e9a4ff8f9a
2 changed files with 27 additions and 23 deletions

View File

@ -71,7 +71,7 @@
</label>
</div>
<!-- <button class="dap-full-button-green js-remember-btn js-authz-remember-me">SIGN IN ONCE</button> -->
<button type="submit" class="btn btn-primary submit-btn dap-full-button-green js-remember-btn js-authz-remember-me">Submit</button>
<button type="submit" class="btn btn-primary submit-btn dap-full-button-green js-remember-btn js-authz-remember-me" disabled>Submit</button>
<!-- <a href="./authnocode.html" target="_blank" class="btn btn-primary">Send Code Again</a> -->
<button class="btn btn-primary js-edit-email-button" type="button">Edit My Email</button>
</form>

View File

@ -69,8 +69,8 @@ $('body').on('click', '.js-auth-li-enabled', function (ev) {
}
});
// $('body').on('keyup keypress', '.js-authn-otp-code', function (e) {
// 'use strict';
$('body').on('keyup keypress', '.js-authn-otp-code', function (e) {
'use strict';
// var keyCode = e.keyCode || e.which;
// var regex = new RegExp('^[0-9 \-]+$');
// var key = String.fromCharCode(!e.charCode ? e.which : e.charCode);
@ -90,7 +90,11 @@ $('body').on('click', '.js-auth-li-enabled', function (ev) {
// if($(this).val().length === $(this).attr("maxlength")){
// $('.submit-btn').prop("disabled", false);
// }
// });
if ($(this).val().length === 14) {
$('.submit-btn').prop('disabled', false);
}
});
$('.js-authn-otp-code').mask('####-####-####');