js form action动态修改方法
人气:1
一般比较简单的就是
document.formName.action="https://img.qb5200.com/download-x/dddd.do?ddd="+str
document.formName.submit();
写成函数式的调用就是
<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" onclick="checkaction(1);" />
<input type="submit" class="btn" value="{lang dbStartFix}" name="resubmit" onclick="checkaction(0);" />
</form>
document.formName.action="https://img.qb5200.com/download-x/dddd.do?ddd="+str
document.formName.submit();
写成函数式的调用就是
复制代码 代码如下:
<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" onclick="checkaction(1);" />
<input type="submit" class="btn" value="{lang dbStartFix}" name="resubmit" onclick="checkaction(0);" />
</form>
加载全部内容