1个回答
2013-07-19
展开全部
可以用脚本去实现无刷新页面替换验证码:以下就用Struts写你例子你看下。<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>用户登录</title>
<meta http-equiv="description" content="ruilei@163.com">
<script type="text/javascript">
function onRefImage(){
var images = document.getElementById("images");
images.src="/image.do";
}
</script>
</head>
<body>
<form action="/login.do" method="post">
<div>
<ul>
<li class="title">登录名:</li>
<li><input class="text" type="text" name="cpMember"> <a href="/register.html">我要注册</a></li>
</ul>
<ul>
<li class="title">密 码:</li>
<li><input class="text" type="password" name="password"> <a href="#">忘记密码</a></li>
</ul>
<ul>
<li class="title">验证码:</li>
<li>
<input class="band" type="text" name="band"> <img id="images" src="/image.do" onclick="this.src='/image.do'"><a href="javascript:onRefImage();">看不清,换一张</a>
</li>
</ul>
<ul>
<li class="title"></li>
<li><input type="submit" value="登 录"></li>
</ul>
</div>
</form>
</body>
</html>
<html>
<head>
<title>用户登录</title>
<meta http-equiv="description" content="ruilei@163.com">
<script type="text/javascript">
function onRefImage(){
var images = document.getElementById("images");
images.src="/image.do";
}
</script>
</head>
<body>
<form action="/login.do" method="post">
<div>
<ul>
<li class="title">登录名:</li>
<li><input class="text" type="text" name="cpMember"> <a href="/register.html">我要注册</a></li>
</ul>
<ul>
<li class="title">密 码:</li>
<li><input class="text" type="password" name="password"> <a href="#">忘记密码</a></li>
</ul>
<ul>
<li class="title">验证码:</li>
<li>
<input class="band" type="text" name="band"> <img id="images" src="/image.do" onclick="this.src='/image.do'"><a href="javascript:onRefImage();">看不清,换一张</a>
</li>
</ul>
<ul>
<li class="title"></li>
<li><input type="submit" value="登 录"></li>
</ul>
</div>
</form>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询