<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'validate.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
</head>
<script type="text/javascript">
//Jquery代码
$(document).ready(function(){
//拿到form调用验证方法
$("empForm").validate({
rules:{
name: "required"
},
messages:{
name: "姓名不能为空"
}
});
});
</script>
<body>
<form action="" name="empForm" id="empForm" method="post">
Name:<input name="name" id="name"/><br/>
Password:<input type="password" name="password" id="password"/>
<input type="submit" value="User" name="submit" id="submit"/>
</form>
</body>
</html>
jquery 验证框架 jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'validate.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
</head>
<script type="text/javascript">
//Jquery代码
$(document).ready(function(){
//拿到form调用验证方法
$("empForm").validate({
rules:{
name: "required"
},
messages:{
name: "姓名不能为空"
}
});
});
</script>
<body>
<form action="" name="empForm" id="empForm" method="post">
Name:<input name="name" id="name"/><br/>
Password:<input type="password" name="password" id="password"/>
<input type="submit" value="User" name="submit" id="submit"/>
</form>
</body>
</html>
jquery 验证框架 jsp
解决方案 »
- 一个留言板小程序,为什么点击了页面没反应....
- 收藏 不显示删除回复显示所有回复显示星级回复显示得分回复 Flex如何接收java返回的对象,并和dataGrid进行绑定
- 求助(在线等):自己写的.ocx控件,在jsp上用object调用,为什么其他机器上无法正常调用?(控件均已注册,本机可以调用)
- 寻找统计图现成的插件或包,
- 奇菜的问题:如何用jsp实现把一文件传入制定的目录?
- JSP的<%%>区中如何直接调用自定义的javascript函数?
- 在jsp中不能编译的原因
- 谁能解决这个问题,本人将送出The JasperReports Ultimate Guide.pdf文档!!!
- 请教:jsp为何能显示目录结构?
- 有谁知道怎么样在5460上免费上传照片?[50分]
- 关于myeclipse的问题???请教高人指教!
- ssm 框架和 servlet
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'validate.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="./js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="./js/jquery.validate.js"></script>
</head>
<script type="text/javascript">
//Jquery代码
$(document).ready(function(){
//拿到form调用验证方法
$("#empForm").validate({
rules:{
name: "required"
},
messages:{
name: "姓名不能为空"
}
});
});
</script>
<body>
<form action="" name="#empForm" id="#empForm" method="post">
Name:<input name="name" id="name"/><br/>
Password:<input type="password" name="password" id="password"/>
<input type="submit" value="User" name="submit" id="submit"/>
</form>
</body>
</html>
路径确实没错误,