<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<script type="text/javascript">
function ShowMessage()
{
if(document.getElementById("txtName").value=="")
{
alert("请输入用户名!");
return false;
}
else if(document.getElementById("txtPwd").value=="")
{
alert("请输入用户密码!");
return false;
}
else if(document.getElementById("txtTel").value=="")
{
alert("请输入电话号码!");
return false;
}
else if(document.getElementById("txtEmail").value=="")
{
alert("请输入用户邮箱!");
return false;
}
}
</script>
</head>
<body>
name:<input id="txtName" type="text" />
<br />
pwd:<input id="txtPwd" type="text" />
<br />
Tel:<input id="txtTel" type="text" />
<br />
Email:<input id="txtEmail" type="text" />
<br />
<input id="Button1" type="button" value="非空验证" onclick="return ShowMessage()" />
</body>
</html>