removing some validation

This commit is contained in:
Jon Lambson 2017-06-19 16:07:53 -06:00
parent 18ac5d8959
commit ccb8f2537c
2 changed files with 28 additions and 22 deletions

View File

@ -73,7 +73,7 @@
<!-- <button class="dap-full-button-green js-remember-btn js-authz-remember-me">SIGN IN ONCE</button> -->
<button type="button" class="btn btn-primary">Send Code Again</button>
<button type="button" class="btn btn-primary">Edit My Email</button>
<button type="button" class="btn btn-primary submit-btn dap-full-button-green js-remember-btn js-authz-remember-me" disabled>Submit</button>
<button type="button" class="btn btn-primary submit-btn dap-full-button-green js-remember-btn js-authz-remember-me">Submit</button>
</form>
<!-- <a href="./authnocode.html" target="_blank">
<p class="dap-centered-text dap-help-text">I didn't receive my code...</p>

View File

@ -34,6 +34,7 @@
// }
// });
$('body').on('click', '.js-remember-label', function (ev) {
'use strict';
ev.preventDefault();
ev.stopPropagation();
var $this = $(this);
@ -45,6 +46,7 @@ $('body').on('click', '.js-remember-label', function (ev) {
});
$('body').on('click', '.check', function () {
'use strict';
var $img = $(this);
if($img.attr("src") === "./img/pressed-check.png") {
$img.attr("src", "./img/unpressed-check.png");
@ -56,6 +58,7 @@ $('body').on('click', '.check', function () {
});
$('body').on('click', '.js-auth-li-enabled', function (ev) {
'use strict';
ev.preventDefault();
ev.stopPropagation();
var $this = $(this);
@ -66,29 +69,31 @@ $('body').on('click', '.js-auth-li-enabled', function (ev) {
}
});
$('body').on('keyup keypress', '.js-authn-otp-code', function (e) {
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);
// }
// });
$('body').on('keyup', '.js-oauth3-email', function () {
'use strict';
var emailAddress = $(this).val();
var emailRegex = new RegExp(/^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$/i);
var valid = emailRegex.test(emailAddress);
@ -102,6 +107,7 @@ $('body').on('keyup', '.js-oauth3-email', function () {
});
$('body').on('blur', '.js-oauth3-email', function () {
'use strict';
var emailAddress = $(this).val();
$('.email-address').text(emailAddress);
});