<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="javascript">
<!--
function isfull(){
if (document.dd.username.value==""){
alert("用户名不能为空");
document.dd.username.focus();
return false;
}
if (document.dd.password.value==""){
alert("密码不能为空");
document.dd.password.focus();
return false;
}
return true;}
</script>
<body>
<form name="dd" method="post" action="" onSubmit="return isfull();">
<input type="text" name="username">
<input type="text" name="password">
<input type="submit" name="Submit" value="提交">
</form>
</body>
</html>
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="javascript">
<!--
function isfull(){
if (document.dd.username.value==""){
alert("用户名不能为空");
document.dd.username.focus();
return false;
}
if (document.dd.password.value==""){
alert("密码不能为空");
document.dd.password.focus();
return false;
}
return true;}
</script>
<body>
<form name="dd" method="post" action="" onSubmit="return isfull();">
<input type="text" name="username">
<input type="text" name="password">
<input type="submit" name="Submit" value="提交">
</form>
</body>
</html>