diff --git a/index.html b/index.html index 7fdefd7..e1ef2f2 100644 --- a/index.html +++ b/index.html @@ -71,7 +71,7 @@ - + diff --git a/js/script.js b/js/script.js index ae26237..1a5c63c 100644 --- a/js/script.js +++ b/js/script.js @@ -69,28 +69,32 @@ $('body').on('click', '.js-auth-li-enabled', function (ev) { } }); -// $('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); -// var oauthCode = $(this).val().split('-').join('').replace(/\s/g, ''); -// -// if (!regex.test(key)) { -// event.preventDefault(); -// return false; -// } -// -// if (oauthCode.length > 0) { -// oauthCode = oauthCode.match(new RegExp('.{1,4}', 'g')).join("-"); -// } -// -// $(this).val(oauthCode); -// -// if($(this).val().length === $(this).attr("maxlength")){ -// $('.submit-btn').prop("disabled", false); -// } -// }); +$('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); + // var oauthCode = $(this).val().split('-').join('').replace(/\s/g, ''); + // + // if (!regex.test(key)) { + // event.preventDefault(); + // return false; + // } + // + // if (oauthCode.length > 0) { + // oauthCode = oauthCode.match(new RegExp('.{1,4}', 'g')).join("-"); + // } + // + // $(this).val(oauthCode); + // + // 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('####-####-####');