用戶註冊時在輸入賬號的時候如果已存在該賬戶則出現提示信息
阿新 • • 發佈:2018-03-15
function == ddr script false add blog input val
// 當註冊賬戶已存在 $(‘.login-form‘).find(‘.address-email‘).on(‘input‘, function () { var $this = $(this), email = $.trim($this.val()), pattern = /\w+([\-+.‘]\w+)*@\w+([\-.]\w+)*\.\w+([\-.]\w+)*/, ajaxRegisterEmail, recognised = $this.next(‘.recognised‘), submitBtn = $this.parent().siblings(‘.buttons‘).find(‘.btn-submit‘); if (ajaxRegisterEmail !== undefined) { ajaxRegisterEmail.abort(); } if (email !== ‘‘ && pattern.test(email)) { ajaxRegisterEmail = $.ajax({ url: eventure.getUncachedUrl(‘/Base/BaseHandler‘), type: ‘POST‘, data: { pt: ‘check-email-exist‘, email: email }, success: function (data) { if (data.status === ‘f‘) { recognised.show().text(data.message); $this.addClass(‘input-validation-error‘); submitBtn.addClass(‘disabled‘).removeClass(‘btn-red‘).prop(‘disabled‘, true); } else { recognised.hide(); $this.removeClass(‘input-validation-error‘); submitBtn.removeClass(‘disabled‘).addClass(‘btn-red‘).prop(‘disabled‘, false); } } }) } });
用戶註冊時在輸入賬號的時候如果已存在該賬戶則出現提示信息