校驗詳情:
1. 每個輸入框,滑鼠移入,移出時,跟隨浮出資訊提示(正確的資料輸入格式)
2. 每個輸入框,輸入資料時,格式錯誤,輸入框變紅,輸入框後給出紅色文字提示;輸入正確時,輸入框變回之前樣式,錯誤提示文字消失
3. 全部輸入完畢或不輸入任何資料直接點"註冊"按鈕時,對輸入框,從上至下依次校驗,如果全部正確,提交後台;
js校驗**:
reg.js
function reg_input(e, str)
if (!othis.sug)
var e = e || window.event,
obj = othis.sug,
dr = othis.dr,
ifr = othis.ifr;
obj.sug.innerhtml = str;
var w = obj.sug.offsetwidth,
h = obj.sug.offsetheight,
dw = document.documentelement.clientwidth || document.body.clientwidth;
dh = document.documentelement.clientheight || document.body.clientheight;
var st = document.documentelement.scrolltop || document.body.scrolltop,
sl = document.documentelement.scrollleft || document.body.scrollleft;
var left = e.clientx + sl + 17 + w < dw + sl && e.clientx + sl + 15 || e.clientx + sl - 8 - w,
top = e.clienty + st + 17 + h < dh + st && e.clienty + st + 17 || e.clienty + st - 5 - h;
obj.style.left = left + 10 + 'px';
obj.style.top = top + 10 + 'px';
dr.style.width = w + 'px';
dr.style.height = h + 'px';
ifr.style.width = w + 3 + 'px';
ifr.style.height = h + 3 + 'px';
obj.style.visibility = 'visible';
document.onmousemove = function(e)
}function user_reg()
var reg = new regexp("^[_a-za-z0-9]$");
if (!reg.test(document.getelementbyid('username').value))
var reg1 = new regexp("^[a-za-z]$");
if (reg1.test(document.getelementbyid('username').value))
var reg2 = new regexp("^[0-9]$");
if (reg2.test(document.getelementbyid('username').value))
document.getelementbyid('ulog').innerhtml = "";
return true;
}function pass_reg()
if (document.getelementbyid('password').value == document
.getelementbyid('username').value)
var reg = new regexp("^[_a-za-z0-9]$");
if (!reg.test(document.getelementbyid('password').value))
var reg11 = new regexp("^[a-za-z]$");
if (reg11.test(document.getelementbyid('password').value))
var reg21 = new regexp("^[0-9]$");
if (reg21.test(document.getelementbyid('password').value))
document.getelementbyid('plog').innerhtml = "";
return true;
}function newpass_reg()
if (document.getelementbyid('newpassword').value != document
.getelementbyid('password').value)
document.getelementbyid('nplog').innerhtml = "";
return true;
}function email_reg()
if (!isemail(document.getelementbyid('email').value))
document.getelementbyid('elog').innerhtml = "";
return true;
}function code_reg()
document.getelementbyid('clog').innerhtml = "";
return true;
}function tel_reg() -\d)|(1[3584]\d))$/;
// 手機,固話同時驗證
if (!reg11.test(telephone))
} document.getelementbyid('tlog').innerhtml = "";
return true;
}function ent_reg()
document.getelementbyid('entlog').innerhtml = "";
return true;
}function pro_reg()
document.getelementbyid('prolog').innerhtml = "";
return true;
}function isemail(stremail)
function nor_reg() else
}function stu_reg() else
}
註冊頁面**:
regist.html
208 beego使用者註冊校驗
beego使用者註冊校驗 頁面說明 1.index 2.list 3.detail 4.cart 5.place order 6.login 7.register 8.user center info 9.user center order 10.user center site 先來看一下js 在...
使用者註冊介面js校驗 表單提示
charset utf 8 新使用者註冊title head form divlabel span inputtext style 使用者名稱 function yhmonblus var re a za z if username.value else if username.value.leng...
Ajax和Jquery非同步校驗註冊時使用者名稱是否存在
ajax的get方式提交請求 function ajax get 3.設定請求路徑 xhr.open get web14 ajaxservlet1?name aaa pass 123 true 4.傳送請求 xhr.send null 建立非同步物件 ajax的post方式提交請求 function...