?? check.js
字號:
function checkuserinfo()
{
if(checkspace(document.userinfo.username.value)) {
document.userinfo.username.focus();
alert("對不起,請填寫用戶名!");
return false;
}
if(checkspace(document.userinfo.userpassword.value) || document.userinfo.userpassword.value.length < 5 || document.userinfo.userpassword.value.length >10) {
document.userinfo.userpassword.focus();
alert("密碼長度不能不能這空,在5位到10位之間,請重新輸入!");
return false;
}
if(document.userinfo.userpassword.value != document.userinfo.userpassword1.value) {
document.userinfo.userpassword.focus();
document.userinfo.userpassword.value = '';
document.userinfo.userpassword1.value = '';
alert("兩次輸入的密碼不同,請重新輸入!");
return false;
}
if(document.userinfo.useremail.value.length!=0)
{
if (document.userinfo.useremail.value.charAt(0)=="." ||
document.userinfo.useremail.value.charAt(0)=="@"||
document.userinfo.useremail.value.indexOf('@', 0) == -1 ||
document.userinfo.useremail.value.indexOf('.', 0) == -1 ||
document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 ||
document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
{
alert("Email地址格式不正確!");
document.userinfo.useremail.focus();
return false;
}
}
else
{
alert("Email不能為空!");
document.userinfo.useremail.focus();
return false;
}
if(checkspace(document.userinfo.quesion.value)) {
document.userinfo.quesion.focus();
alert("對不起,請填寫密碼提問!");
return false;
}
if(checkspace(document.userinfo.answer.value)) {
document.userinfo.answer.focus();
alert("對不起,請填寫密碼提問的答案!");
return false;
}
}
function checkshouhuoxx()
{
if(checkspace(document.shouhuoxx.userzhenshiname.value)) {
document.shouhuoxx.userzhenshiname.focus();
alert("對不起,請填寫真實姓名!");
return false;
}
if(checkspace(document.shouhuoxx.shouhuodizhi.value)) {
document.shouhuoxx.shouhuodizhi.focus();
alert("對不起,請填寫收貨人詳細收貨地址!");
return false;
}
if(checkspace(document.shouhuoxx.youbian.value)) {
document.shouhuoxx.youbian.focus();
alert("對不起,請填寫郵編!");
return false;
}
if(document.shouhuoxx.youbian.value.length!=6) {
document.shouhuoxx.youbian.focus();
alert("對不起,請正確填寫郵編!");
return false;
}
if(checkspace(document.shouhuoxx.usertel.value)) {
document.shouhuoxx.usertel.focus();
alert("對不起,請留下您的聯系電話!");
return false;
}
if(checkspace(document.shouhuoxx.songhuofangshi.value)) {
document.shouhuoxx.songhuofangshi.focus();
alert("對不起,您還沒有選擇送貨方式!");
return false;
}
if(checkspace(document.shouhuoxx.zhifufangshi.value)) {
document.shouhuoxx.zhifufangshi.focus();
alert("對不起,您還沒有選擇支付方式!");
return false;
}
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -