方法 1:
<form id = "form1" name = "form1" method = "post" action = "../ news/index.asp"> <таблица cellPadding = "0" "cellSpacing =" 0 "> <tr> <td> <name =" "Ключевое слово" type = "text" id = "cayford"/> </td> </tr> <tr> <td> <see = "search" = "идентификатор search OnChange = "searchType1 ();"> <option value = "news" selected = "selected"> 新闻中心 </option> <vitue value = "case"> 工程案例 </option> </select> <input type = "name =" pospot "value =" 搜索 "/> </td> </tr> </table> </form> <script =" javascript "> var 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").方法 2 :
<html> <Head> <script language = "javascript"> function check () {if (document.form1.a [0] .cecked == true) document.form1.action = "1.htm" elsedocument.form1.action = "2.htm"} </script> </head> <body> <form name = "form1" method "=" Action "action" "action" = "" Action "=" "Action" = "" Action = "" Action = "" Action "" action "=" onsubmit = "check ();"> 转到页面一 <input type = "radio" name = "a"> 转到页面二 <input type = "radio" name = "a"> <input name = "" type = "value =" 提交 "> </form> </body> </html>以上这篇用 JS 动态改变表单 Форма 里的 Действие 值属性的两种方法就是小编分享给大家的全部内容了 , 希望能给大家一个参考 , 也希望大家多多支持武林网。