<html>
<title></title>
<script language="javascript">
function fun(){
if(form1.user.value=="")
{
alert("用户名不能为空!");
form1.user.focus();
return false;
}
if(form1.pwd.value=="")
{
alert("密码不能为空!");
form1.pwd.focus();
return false;
}
}
</script>
<body>
<form name="form1" action="check.jsp" method="post" onsubmit="return fun()" >
用户名:<input type="text" name="user"><br>
密 码:<input type="password" name="pwd"><br>
<input type="submit" value="提交" >
<input type="reset" value="重置">
</form>
</body>
</html>
简单例子
<title></title>
<script language="javascript">
function fun(){
if(form1.user.value=="")
{
alert("用户名不能为空!");
form1.user.focus();
return false;
}
if(form1.pwd.value=="")
{
alert("密码不能为空!");
form1.pwd.focus();
return false;
}
}
</script>
<body>
<form name="form1" action="check.jsp" method="post" onsubmit="return fun()" >
用户名:<input type="text" name="user"><br>
密 码:<input type="password" name="pwd"><br>
<input type="submit" value="提交" >
<input type="reset" value="重置">
</form>
</body>
</html>
简单例子
解决方案 »
- java线程
- IllegalArgumentException occurred calling getter of com.sws.model.Employee.id
- 前辈们,帮我看看我这个水平能要多少钱一个月
- 求<<精通EJB>>2.0的中文版
- 请教文件下载的问题 急急急 请大家帮忙
- hibernate删除数据异常
- 熟悉hibernate的人请进。请问用hibernate如何处理多个数据库更新的问题。
- 如何在struts-config.xml中设置 <forward name="success" path="关闭页面"/>
- struts 中的权限问题
- 谁有webservices3_kit的注册码啊??
- 用java编写百马百瓦问题
- 技术讨论
um.remove(oldu.n);
新密码: um.put(newu);}
效率低,但代码容易,适合初学者