一个form控制多个action的方法 出错!!!!!!!!!
js代码!!!!!!!!!!!!!!!!!!
<script>
function button(){
document.getElementById("update").attributes['action']="page0_delete.jsp";
document.getElementById("update").submit();
// document.getElementById("update").action=]="page0_delete.jsp";
//document.getElementById("update").submit();
//这两种都出一样的错误,我用的是ie8
}
</script>
jsp的form代码!!!!!!!!!!!!!!
<form action="page0_update.jsp" method="post" name="update" id="update">
“………………………………………………
…………………………………………………………”
<input type="submit" name="submit" value="修改">
<input type="button" name="submit" onclick="gogo()" value="删除">
</form>
出错!!!!!
脚本错误 :不支持此属性或方法!!!!!
请问各位大侠这是为什么??????? 谢谢
------解决方案--------------------
HTML code
<html>
<head>
<script>
function func1()
{
document.getElementById("myform").getAttribute("action").value="b.html";
document.getElementById("myform").submit();
}
function func2()
{
document.getElementById("myform").action="b.html";
document.getElementById("myform").submit();
}
</script>
</head>
<body>
<form action="b.html" id="myform" name="myform">
<input type="button" value="提交1" onclick="func1();" name="sub1" id="sub1"/>
<input type="button" value="提交2" onclick="func2()" name="sub2" id="sub2"/>
</form>
</body>
</html>