js脚本:
<SCRIPT LANGUAGE="javascript">
function doUrl(actionUrl)
{
verform.action = actionUrl;
verform.submit();
}
</SCRIPT>
form表单控制:
<form method="POST" name="verform" action="">
……
<input type="button" value="删除" name="B1" onClick=doUrl("delVersion.do")><input type="button" value="修改" name="B2" onClick=doUrl("modVersion.do")>
</form>
<script language="JavaScript" >
function checkaction(v){
if(v==0){
document.dbform.action="index.php?admin_db-repair";
}else{
document.dbform.action="index.php?admin_db-optimize";
}
dbform.submit();
}
</script>
<form action="" method="post" name="dbform">
<input type="submit" class="btn" value="{lang dbStartOptimize}" name="opsubmit" οnclick="checkaction(1);" />
<input type="submit" class="btn" value="{lang dbStartFix}" name="resubmit" οnclick="checkaction(0);" />
</form>
<script>
function replace(){
myForm.action='bb.html';
myForm.method='POST';
myForm.submit();
}
</script>
<form id="myForm" name="myForm" method="post" action="aa.html">
<input type="button" value="dd" οnclick="replace();" />
</form>
使用这个方法可以使用多个内容来提交表单
myForm.action='index.php?act=edit';
myForm.method='POST';
myForm.submit();
myForm.action='index.php?act=del';
myForm.method='POST';
myForm.submit();
发表评论 取消回复