<div class="form-group">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
<input type="password" name="password2" required data-password="password" class="form-control" placeholder="重復(fù)密碼"/>
</div>
</div>
以上代碼刪除
<script type="text/javascript">
$(document).keydown(function(event){
if(event.keyCode ==13){
checkUser();
return false;
}
});
function fleshVerify(){
var src = "{eyou:url link='api/Ajax/vertify' vars='type=users_reg' /}";
if (src.indexOf('?') > -1) {
src += '&';
} else {
src += '?';
}
src += 'r='+ Math.floor(Math.random()*100);
$('#imgVerifys').attr('src', src);
}
function checkUser(){
var username = $('#theForm input[name=username]');
var password = $('#theForm input[name=password]');
var password2 = $('#theForm input[name=password2]'); --//注釋掉
if(username.val() == ''){
layer.msg('用戶名不能為空!', {time: 1500});
username.focus();
return false;
}
if(password.val() == ''){
layer.msg('登錄密碼不能為空!', {time: 1500});
password.focus();
return false;
}
注釋掉以下
if(password2.val() != password.val()){
layer.msg('兩次密碼不一致!', {time: 1500});
password.focus();
return false;
}
注釋結(jié)束
layer_loading('正在處理');
$.ajax({
// async:false,
url: "{eyou:url link='user/Users/reg' /}",
data: $('#theForm').serialize(),
type:'post',
dataType:'json',
success:function(response){
layer.closeAll();
var res = response.data;
if(res.status == 0){
layer.msg(response.msg, {time: 1500}, function(){
window.location = response.url;
});
} else if ('vertify' == res.status) {
fleshVerify();
layer.msg(response.msg, {time: 2000});
}else if(res.status == 1){
layer.msg(response.msg, {time: 2000});
}else if(res.status == 2){
layer.msg(response.msg, {time: 1500}, function(){
window.location = response.url;
});
注釋掉開(kāi)始 }else if(res.status == 3){
layer.msg(response.msg, {time: 1500}, function(){
window.location = response.url;
});注釋掉結(jié)束 (是否要注釋可以看效果)
}else{
fleshVerify();
layer.msg(response.msg, {time: 2000});
}
},
error : function() {
layer.closeAll();
fleshVerify();
layer.alert('網(wǎng)絡(luò)失敗,請(qǐng)刷新頁(yè)面后重試', {icon: 5});
}
});
};
</script>
由于時(shí)間關(guān)系 自己按提示修改 注釋看看效果
users_reg.htm