var default_action = "purchase.php"; // 默认action
function changeAction(obj){
var forms = document.forms["form"];
if (obj.value == "到货付款") {
forms.action = "huodao.php";
} else if (obj.value == "在线支付") {
forms.action = "purchase.php";
} else {
forms.action = default_action;
}
forms.submit();
}
class="payed"
name="payment"
value="到货付款"
onclick="changeAction(this);" />
class="payed"
name="payment"
value="在线支付"
checked="checked"
onclick="changeAction(this);" />
还的增加一个普通按钮
点击支付时:onclick事件里,var form1=document.getElementById('form'),
form1.submit();//调用表单的提交方法。
点击货到付款,同上,只是改下form1.action='huodao.php'