<html>
<head>
<script language="javascript">
function check()
{
if (this.form1.NickName.value=="")
{
alert("请填写用户名!");
this.form1.NickName.focus();
return false;
}
if (this.form1.Password.value=="" || this.form1.Rpwd.value=="")
{
alert("请填写密码!");
this.form1.Password.focus();
return false;
}
}
</script>
<title></title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body>
<div align=center>
<form name=form1 action=AddUser.php method=post onsubmit="return check()">
<table width="600" height="321" border="1" cellpadding="0" cellspacing="1" bordercolor="#8C63A4" bgcolor="#999999">
<tr align="center">
<td height="32" colspan="2" bgcolor="#fafafa">公司新员工注册(**表示必须填项)</td>
</tr>
<tr>
<td align="right" bgcolor="#fafafa"><div align=right>用户名:</div></td>
<td bgcolor="#fafafa"><input name=NickName type=text id="NickName" size=16>
<span class="style1">**</span></td>
</tr>
<tr>
<td align="right" bgcolor="#fafafa"><div align=right>密码:</div></td>
<td bgcolor="#fafafa"><input name=Password type=password id="Password" size=12>
<span class="style1">**</span></td>
</tr>
<tr>
<td align="right" bgcolor="#fafafa">密码确认:</td>
<td bgcolor="#fafafa"><input type="text" name="Rpwd" size=12>
<span class="style1">**</span></td>
</tr>
</table>
<p></p>
<input type=submit value="注 册"> <input type=reset value="取 消">
</form>
</div>
<head>
<script language="javascript">
function check()
{
if (this.form1.NickName.value=="")
{
alert("请填写用户名!");
this.form1.NickName.focus();
return false;
}
if (this.form1.Password.value=="" || this.form1.Rpwd.value=="")
{
alert("请填写密码!");
this.form1.Password.focus();
return false;
}
}
</script>
<title></title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body>
<div align=center>
<form name=form1 action=AddUser.php method=post onsubmit="return check()">
<table width="600" height="321" border="1" cellpadding="0" cellspacing="1" bordercolor="#8C63A4" bgcolor="#999999">
<tr align="center">
<td height="32" colspan="2" bgcolor="#fafafa">公司新员工注册(**表示必须填项)</td>
</tr>
<tr>
<td align="right" bgcolor="#fafafa"><div align=right>用户名:</div></td>
<td bgcolor="#fafafa"><input name=NickName type=text id="NickName" size=16>
<span class="style1">**</span></td>
</tr>
<tr>
<td align="right" bgcolor="#fafafa"><div align=right>密码:</div></td>
<td bgcolor="#fafafa"><input name=Password type=password id="Password" size=12>
<span class="style1">**</span></td>
</tr>
<tr>
<td align="right" bgcolor="#fafafa">密码确认:</td>
<td bgcolor="#fafafa"><input type="text" name="Rpwd" size=12>
<span class="style1">**</span></td>
</tr>
</table>
<p></p>
<input type=submit value="注 册"> <input type=reset value="取 消">
</form>
</div>
解决方案 »
- php 当查询数据库记录为空,导出Excel表的首行字段有乱码,记录不为空时,就不会出现乱码
- 200分求助CURL设置HTTPHEADER上传文件问题!(补充提问)
- 这代码有什么问题吗?帮忙看看谢谢~
- 为啥 分页 不显示呢 弟弟没有分了
- 新手问查询数据库
- php 用正则表达式函数实现替换字符串首尾的空格的正确写法
- GROUP BY的SQL语句出错,请各位英雄解答
- 程序移植到linux 下就不能用了?谁能帮帮我?
- 提供免费ftp,供大家交流
- 用split可以转成数组,但用什么方法可将数组换成字串呢?
- ◆◆◆◆ php+mysql读数据库问题-----在线等!!!◆◆◆◆
- 如何在javascript中访问php变量
把最后的
return true;
去掉了
<script language="JavaScript" type="text/JavaScript">
function check()
{
if (document.insert_form.NickName.value=="")
{
alert("请填写用户名!");
return false;
}
else if (document.insert_form.Password.value=="" || document.insert_form.Rpwd.value=="")
{
alert("请填写密码!");
return false;
}}
</script>
不好意思,应该将类似document.insert_form.NickName.value改成document.form1.NickName.value呵呵~~其实楼上两位他们都已经解决了