⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userfunction.asp

📁 佳可商务购物程序v1.0
💻 ASP
字号:
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}

function checkshouhuoxx()
{
   if(checkspace(document.shouhuoxx.dadyname.value)) {
	document.shouhuoxx.dadyname.focus();
    alert("对不起,请填写性质!");
	return false;
  }
   if(checkspace(document.shouhuoxx.MoMname.value)) {
	document.shouhuoxx.MoMname.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((document.shouhuoxx.MoMNo.value.length!=15)&&(document.shouhuoxx.MoMNo.value.length!=18)) {
	document.shouhuoxx.MoMNo.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 regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}

function checkuserinfo()
{
 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;
   }
}

function check0()
{
   if(checkspace(document.ckxp0.username.value)) {
	document.ckxp0.username.focus();
    alert("请输入您的用户名!");
	return false;
  }
  }
  function check1()
{
   if(checkspace(document.ckxp1.answer.value)) {
	document.ckxp1.answer.focus();
    alert("请填写密码答案!");
	return false;
  }
  }
   function check2()
{
   if(checkspace(document.ckxp2.userpassword1.value)) {
	document.ckxp2.userpassword1.focus();
    alert("请输入新密码!");
	return false;
  }
  if(checkspace(document.ckxp2.userpassword2.value)) {
	document.ckxp2.userpassword2.focus();
    alert("请输入确认密码!");
	return false;
  }
  if(document.ckxp2.userpassword1.value != document.ckxp2.userpassword2.value) {
	document.ckxp2.userpassword1.focus();
	document.ckxp2.userpassword1.value = '';
	document.ckxp2.userpassword2.value = '';
    alert("两次输入的密码不同,请重新输入!");
	return false;
  }
}

function checkrepass()
{
   if(checkspace(document.userpass.userpassword.value)) {
	document.userpass.userpassword.focus();
    alert("对不起,请填写您的原密码!");
	return false;
  }
     if(checkspace(document.userpass.userpassword1.value)) {
	document.userpass.userpassword1.focus();
    alert("对不起,您还没有填新密码!");
	return false;
  }
     if(checkspace(document.userpass.userpassword2.value)) {
	document.userpass.userpassword2.focus();
    alert("对不起,您还没有填确认密码!");
	return false;
  }
   if(document.userpass.userpassword1.value != document.userpass.userpassword2.value) {
	document.userpass.userpassword1.focus();
	document.userpass.userpassword1.value = '';
	document.userpass.userpassword2.value = '';
    alert("两次输入的密码不同,请重新输入!");
	return false;
  }
}

  function checkuu()
{
    if(checkspace(document.loginfo.username.value)) {
	document.loginfo.username.focus();
    alert("用户名不能为空!");
	return false;
  }
    if(checkspace(document.loginfo.userpassword.value)) {
	document.loginfo.userpassword.focus();
    alert("密码不能为空!");
	return false;
  }
	
  }
//-->
</script> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -