参考下面的,主要是表单form需要设置一个id,然后利用javascript提交表单例子中是5秒后提交表单
这里的form也可以是 s:form 都没关系,本质是一样的<html>
<head>
<title>自动提交表单</title>
<script type="text/javascript">
function autoSubmit(){
document.getElementById('myForm').submit();
}
setTimeout(autoSubmit,5000);
</script>
</head>
<body>
<form id="myForm" action="/myaction.action">
<input type="text" id="usrname" name="username"/>
<input type="text" id="password" name="password" />
</form>
</body>
</html>
这里的form也可以是 s:form 都没关系,本质是一样的<html>
<head>
<title>自动提交表单</title>
<script type="text/javascript">
function autoSubmit(){
document.getElementById('myForm').submit();
}
setTimeout(autoSubmit,5000);
</script>
</head>
<body>
<form id="myForm" action="/myaction.action">
<input type="text" id="usrname" name="username"/>
<input type="text" id="password" name="password" />
</form>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货