方法 1:
<form id = "form1" name = "form1" method = "post" action = "../ news/index.asp"> <tabela CellPadding = "0" CellSpacing = "0"> <tr> <t> <td> <input name = "keyword" type = "text" id = "key"/> </td> </tr> <pre> <t> onnchange = "SearchType1 ();"> <opção value = "news" selected = "Selected"> 新闻中心 </pption> <opção value = "case"> 工程案例 </pption> </leclect> <input type = "submit" name = "submit" value = "搜索"/> </td> </tre> </tabela> </forma> type = document.getElementById ("SearchType"). Opções [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> <head> <script idioma = "javascript"> function check () {if (document.form1.a [0] .checked == true) document.form1.action = "1.htm" elsedocument.form1.action = "2.htm"} </script> </head> <forn> <form Names) onSubMit = "check ();"> 转到页面一 <input type = "radio" name = "a"> 转到页面二 <input type = "radio" name = "a"> <input name = "" type = "submit" value = "提交"> </morm> </body> </html>以上这篇用 JS 动态改变表单 forma 里的 Ação 值属性的两种方法就是小编分享给大家的全部内容了 , 希望能给大家一个参考 , 也希望大家多多支持武林网。