JavaScriptによるフォームのaction処理方法

サンプルコード

<script language="JavaScript" >
function chkaction(v){
if(v==0){
document.csfrm.action="index.php?bgt-repair";
}else{
document.csfrm.action="index.php?bgt-optimize";
}
csfrm.submit();
}
</script>
<form action="" method="post" name="csfrm">
<input type="submit" class="btn" value="{lang dbStartOptimize}" name="opsubmit" onclick="chkaction(1);" />
<input type="submit" class="btn" value="{lang dbStartFix}" name="resubmit" onclick="chkaction(0);" />
</form>

JavaScript

Posted by arkgame