表单结构,设置form表单的id属性,method="post/get","action"要跳转的页面(jsp或servlet)
<form name="userinfo" id="userinfo" action="judge.jsp" method="post"> ...... ...... ...... </form>
JavaScript
通过id获取对应的表单进行提交
function tosubmit(){ document.getElementById("userinfo").submit(); }
控件的onclick点击
onclick="tosubmit()"
在judge.jsp中根据属性值name获取数据
String uid = request.getParameter("uid");
String password = request.getParameter("password");