Home>

method 1:

<form name="form1" method="post" action="../ news/index.asp">
   <table width="100%" height="43" border="0" cellpadding="0" cellspacing="0"&​​gt;
    <tr>
     <td height="28"><input name="keyword" type="text" /></td>
    </tr>
    <tr>
     <td height="28"><select name="searchtype" onchange="searchtype1 ();">
      <option value="news" selected="selected">News</option>
      <option value="case">Engineering Case</option>
     </select>
     <input type="submit" name="submit" value="search" /></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>

Method 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 ();">
Go to page one<input type="radio" name="a">
Go to page two<input type="radio" name="a">
<input name="" type="submit" value="submit">
</form>
</body>
</html>
  • Previous Using Ajax technology to achieve partial refresh of the quantity and total price of the sample code
  • Next Angularjs filter usage in detail
  • Trends