方法 1 :
<form id="form1" name="form1" method="post" action="../news/index.asp"> <table cellpadding="0" cellspacing="0"> <tr> <td><input name="keyword" type="text" id="keyword"/></td> </tr> <tr> <td><select name="Searchtype" id="Searchtype" onChange = "SearchType1 ();"> <opción Valor = "News" Selected = "Selected"> 新闻中心 </opción> <opción Valor = "Case"> 工程案例 </opción> </select> <input type = "enviar" name = "enviar" value = "搜索"/> </td> </tr> </box> </form> <scritch lingage type = document.getElementById ("SearchType"). Opciones [Document.getElementById ("SearchType"). SelectedIndex] .Value; if (type == "News") {document.getElementById ("form1"). Action = "../ News/Index.asp"} else if (type == "case") {document.getElementById ("form1"). Action = "../ case/index.asp"}}} </script>方法 2 :
<html> <fead> <script language = "javaScript"> function check () {if (document.form1.a [0] .checked == true) document.form1.action = "1.htm" elsedocument.form1.action = "2.htm"} </script> <bead> <body> <name de formule = "método =" post = "acción =" "" "" "" "" "" "" "" "" " onSubMit = "check ();"> 转到页面一 <input type = "radio" name = "a"> 转到页面二 <input type = "radio" name = "a"> <input name = "" type = "shit" value = "提交"> </form> </body> </html>以上这篇用 JS 动态改变表单 Forma 里的 Acción 值属性的两种方法就是小编分享给大家的全部内容了 , 希望能给大家一个参考 也希望大家多多支持武林网。