日期:2014-05-20 浏览次数:20848 次
<script language="javascript"> function check() { var code = document.getElementsByName("session").value; var input = document.getElementsByName("code").value; if(code != input) { alert("验证码不正确"); return false; } else { return true; } } </script>
<form action="index.jsp" method="post"> <input type="hidden" name="session" value="<%=session.getAttribute("zaokurand").toString()%>" /> <div> 验证码:<input style="HEIGHT: 18px" size="8" maxlength="4" type="text" name="code" id="code" /> <span id="rand_img" style="display:block;"> </span> <input type="button" id="button" value="提交" onclick="return check();"/> </div> </form>