<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> com </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK rel="stylesheet" type="text/css" href="xxxxxxxxxx.css"></HEAD><BODY><script language="javascript">
function verify_cust(theform) {
if (theform.id.value=="" && theform.password.value=="")
{
alert("客户id号和密码项不能为空!");
return false;
}
if (theform.id.value=="")
{
alert("请输入客户id号");
return false;
} if(!isInteger(theform.id.value)){
alert("客户id号只能是数字!");
return false;
}
if (theform.password.value=="")
{
alert("请输入密码!");
return false;
}
}
function isInteger(inputVal) {
var iNumber;
if (inputVal.length > 0) {
iNumber = Number(inputVal);
if (isNaN(iNumber))
return false;
else if (String(iNumber).indexOf(".") >= 0)
return false;
}
return true;
}
</script>
<form method="POST" name="vbform" onSubmit="return verify_cust(this)" action="cust/login_form_output.php">
<!--
<input type="hidden" name="action" value="admin">
-->
<table border="1" width="64%">
<tr>
<td width="42%">
<p align="right">客户id号</p>
</td>
<td width="58%"><input type="text" name="id" size="20"></td>
</tr>
<tr>
<td width="42%">
<p align="right">密码</p>
</td>
<td width="58%"><input type="password" name="password" size="20"></td>
</tr>
</table>
<p><input type="submit" value="提交" name="submit"><input type="reset" value="重置" name="reset"></p>
</form>
</body>
</html>试试
<HTML>
<HEAD>
<TITLE> com </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK rel="stylesheet" type="text/css" href="xxxxxxxxxx.css"></HEAD><BODY><script language="javascript">
function verify_cust(theform) {
if (theform.id.value=="" && theform.password.value=="")
{
alert("客户id号和密码项不能为空!");
return false;
}
if (theform.id.value=="")
{
alert("请输入客户id号");
return false;
} if(!isInteger(theform.id.value)){
alert("客户id号只能是数字!");
return false;
}
if (theform.password.value=="")
{
alert("请输入密码!");
return false;
}
}
function isInteger(inputVal) {
var iNumber;
if (inputVal.length > 0) {
iNumber = Number(inputVal);
if (isNaN(iNumber))
return false;
else if (String(iNumber).indexOf(".") >= 0)
return false;
}
return true;
}
</script>
<form method="POST" name="vbform" onSubmit="return verify_cust(this)" action="cust/login_form_output.php">
<!--
<input type="hidden" name="action" value="admin">
-->
<table border="1" width="64%">
<tr>
<td width="42%">
<p align="right">客户id号</p>
</td>
<td width="58%"><input type="text" name="id" size="20"></td>
</tr>
<tr>
<td width="42%">
<p align="right">密码</p>
</td>
<td width="58%"><input type="password" name="password" size="20"></td>
</tr>
</table>
<p><input type="submit" value="提交" name="submit"><input type="reset" value="重置" name="reset"></p>
</form>
</body>
</html>试试
解决方案 »
- javascript判断win7操作系统版本
- window.onResize加在body里怎么控制不了窗体大小呢。。
- 超级大难题,求助!!!
- 可模糊查询的文本框的函数响应过慢的问题!!求助!!!
- 大家知道有什么可以设定处理表格的功能强大的Web在线编辑器?
- 如何比较两日期时间的大小?
- div能不能让其在所有IE窗口去的最前端?
- 请问有没有办法使form里面的一个输入框不受reset铵钮的影响??
- 听过使用IE的一个工具,就可以把一个delphi编译的exe变成可以在浏览器中运行的程序,有谁知道?
- Angular中,怎么让 setter 检测到可变对象(比如一个对象或对象数组)中值的变化?
- 问几个标记是什么作用?
- 请问,我该如何判断表中的字段值,是字符串还是整形,谢谢
<script language="javascript">
........
var check = /[a-z]/i;
if(check.test(theform.id.value))alert("you are a hacker?");
.....
</script>