方法1:

<form id="form1" name="form1" method="post" action="../news/index.asp">
   <table width="100%" height="43" border="0" cellpadding="0" cellspacing="0">
    <tr>
     <td height="28"><input name="keyword" type="text" style="width:150px" id="keyword"/></td>
    </tr>
    <tr>
     <td height="28"><select name="Searchtype" style="width:110px" id="Searchtype" onchange="Searchtype1();">
      <option value="news" selected="selected">新闻中心</option>
      <option value="case">工程案例</option>
     </select>
     <input type="submit" name="Submit" value="搜索" /></td>
    </tr>
   </table>
 </form>
 <script language="javascript">
 function Searchtype1(){
 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").action="../case/index.asp"}
 }
 </script>

方法2:

<html>
<head>
<script language="javascript">
function check(){
if(document.form1.a[0].checked==true)
document.form1.action="1.htm"
else
document.form1.action="2.htm"
}
</script>
</head>
<body>
<form name="form1" method="post" action="" onSubmit="check();">
转到页面一<input type="radio" name="a">
转到页面二<input type="radio" name="a">
<input name="" type="submit" value="提交">
</form>
</body>
</html> 

以上这篇用JS动态改变表单form里的action值属性的两种方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com

RTX 5090要首发 性能要翻倍!三星展示GDDR7显存

三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。

首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。

据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。