求助,第一次使用script,希望大家指点一下,
下面是用script来验证登录程序代码,其中有些我不理解,我是引用的.达不到效果,
还望大家多多指点,有错的地方请指出来,谢谢
<%@ page contentType="text/html;charset=gb2312" %>
<%@page import="java.sql.*"%>
<html><body bgcolor=pink><font>
<head>
<title>登陆</title>
</head>
<center>
<h1>实验室设备管理系统</h1>
<br>
<br>
<form name="login" action="loginconf.jsp" method="post">
<script language="javascript">
function setlg()
{
document.login.umame.focus();
document.login.upassword.focus();
}
function selec(txt)
{
txt.focus();
txt.select();
}
function chkuname(txt)//检查帐号
{
var nam=document.login.uname;
if(nam.value=="")
{
alert("请输入用户名!");
return false;
}else{
return true;
}
}
function chkupassword()//检查密码
{
var pw=document.login.upassword;
if(pw.value=="")
{
alert("请输入密码!");
return false;
}else{
return true;
}
}
</script>
<table>
<tr><center><td>用户登陆</td>
</tr>
<tr>
<td>用户名:</td>
<td><input type="text" name="uname"</td>
</tr>
<tr>
<td>密 码:</td>
<td><input type="password" name="upassword"></td>
</tr>
<tr>
<td>
<input type="submit" value="登陆">
<input type="reset" value="重置">
<a href ="chpwd.jsp">修改密码</a>
</td>
</tr>
</table>
</form>
</center>
</font></body></html>