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

📄 java_check.asp

📁 不是我做的一个留言板
💻 ASP
字号:
<%
web_id1="../language/"
web_id=web_id1&l_id&"/CHECK.ASP"
call include(web_id)
%>

<script Language="JavaScript">

<!--
function FrontPage_Form3_Validator(theForm)
{


  if (theForm.realname.value.length > 30)
  {
    alert("<%=L_CHECK_USER9%>");
    theForm.realname.focus();
    return (false);
  }

  if (theForm.mphone.value.length > 20)
  {
    alert("<%=L_CHECK_USER11%>");
    theForm.mphone.focus();
    return (false);
  }

  var checkOK = "0123456789-—";
  var checkStr = theForm.mphone.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("<%=L_CHECK_USER12%>");
    theForm.mphone.focus();
    return (false);
  }


  if (theForm.homeaddr.value.length > 100)
  {
    alert("<%=L_CHECK_USER13%>");
    theForm.homeaddr.focus();
    return (false);
  }


  if (theForm.homephone.value.length > 20)
  {
    alert("<%=L_CHECK_USER14%>");
    theForm.homephone.focus();
    return (false);
  }

  var checkOK = "0123456789-—";
  var checkStr = theForm.homephone.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("<%=L_CHECK_USER15%>");
    theForm.homephone.focus();
    return (false);
  }


  if (theForm.postcode.value.length > 8)
  {
    alert("<%=L_CHECK_USER16%>");
    theForm.postcode.focus();
    return (false);
  }

  var checkOK = "0123456789-—.";
  var checkStr = theForm.postcode.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("<%=L_CHECK_USER17%>");
    theForm.postcode.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("<%=L_CHECK_USER18%>");
    theForm.postcode.focus();
    return (false);
  }

  if (theForm.jobaddr.value.length > 100)
  {
    alert("<%=L_CHECK_USER19%>");
    theForm.jobaddr.focus();
    return (false);
  }


  if (theForm.jobphone.value.length > 20)
  {
    alert("<%=L_CHECK_USER20%>");
    theForm.jobphone.focus();
    return (false);
  }

  var checkOK = "0123456789-—";
  var checkStr = theForm.jobphone.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("在 jobphone 域中,只能输入 数字 个字符。");
    theForm.jobphone.focus();
    return (false);
  }

  if (theForm.email.value.length > 30)
  {
    alert("在 email 域中,请最多输入 30 个字符。");
    theForm.email.focus();
    return (false);
  }

  if (theForm.oicq.value.length > 15)
  {
    alert("在 oicq 域中,请最多输入 15 个字符。");
    theForm.oicq.focus();
    return (false);
  }

  var checkOK = "0123456789-—";
  var checkStr = theForm.oicq.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("<%=L_CHECK_USER21%>");
    theForm.oicq.focus();
    return (false);
  }

  if (theForm.msn.value.length > 30)
  {
    alert("<%=L_CHECK_USER22%>");
    theForm.msn.focus();
    return (false);
  }

  if (theForm.website.value.length > 30)
  {
    alert("<%=L_CHECK_USER23%>");
    theForm.website.focus();
    return (false);
  }

  if (theForm.fice.value.length > 80)
  {
    alert("<%=L_CHECK_USER24%>");
    theForm.fice.focus();
    return (false);
}
 return (true);
}
//-->
</script>

⌨️ 快捷键说明

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