方法 1:
<form id = "form1" name = "form1" metheth = "post" action = "../ news / index.asp"> <table cellpadding = "0" CellSpactive = "0"> <tr> <td> <entrée name = "Keyword" type = "text" id = "Keyword" /> </ td> </tr> <tr> <td> <lelect name = "searchtype" id = "Searchtype" onChange = "searchType1 ();"> <option value = "news" selected = "select"> 新闻中心 </ option> <option value = "case"> 工程案例 </ option> </lect> <insey type = "soumi" name = "soumi" value = "搜索" /> </td> </tr> </ table> </form> <script linguisse = "javascrip type = document.getElementById ("SearchType"). Options [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"}} </cript>方法 2:
<html> <éadf> <script linguisse = "javascript"> Fonction check () {if (document.form1.a [0] .checked == true) document.form1.action = "1.htm" elseDocument.form1.action = "2.htm"} </cript> "" onSubmit = "check ();"> 转到页面一 <input type = "radio" name = "a"> 转到页面二 <input type = "radio" name = "a"> <input name = "" type = "soume" value = "提交"> </ form> </body> </html>以上这篇用 JS 动态改变表单 Forme 里的 Action 值属性的两种方法就是小编分享给大家的全部内容了 , 希望能给大家一个参考 , 也希望大家多多支持武林网。