select javascript show hide

0 Cevap php

Ben kullanıcı başka bir seçim kutusu ürün çeşitleri ile görünür ve ürünleri seçiyor örneğin, kullanıcı bir seçim seçtiğinde başka seçim göstermeye çalışıyorum. İşte benim kod

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>TestPage</title>

<script type="text/javascript">
function ProductSelection() {
var selectedValue = document.getElementById("internet").value;
if(selectedValue == "Matchcode")
document.getElementById("Types").style.display = "";
if(selectedValue == "Kaleidoscope")
document.getElementById("Kaleidoscopes").style.display = "";
}
</script>
</head>
<body>
<table align="center">
        <form id="form1" name="form1" method="post" action="process.php">
      <tr><td>Products</td>
      <td>
    <select name="Products" id="Products" onChange="ProductSelection();">
     <option>Select a product....</option>
        <option value="Matchcode">Matchcode</option>
        <option value="Nearcode">Nearcode</option>
        <option value="Kaleidoscope">Kaleidoscope Plus</option>
        <option value="Kaleidoscope">Matchcode Kaleidoscope</option>
      </select>
      </td>
   </tr>
   <tbody id="Types" style="display:none">
   <tr><td>Type:</td>
   <td><select name="Types" id="Types" title="Types">
   <option value="UK">UK</option>
   <option value="USA">USA</option>
   <option value="Canada">Canada</option>
   <option value="DNB">DNB</option>
   <option value="Names">Names</option>
   </select></td></tr></tbody>
   <tbody id="Kaleidoscopes" style="display:none">
   <tr><td>Type:</td>
   <td><select name="Kaleidoscopes" id="Kaleidoscopes" title="Kaleidoscopes">
   <option value="New Zealand">New Zealand</option>
   </select>
   </td></tr></tbody>


  <tr><td>Computers:</td>
  <td>
    <select name="Computers" id="Computers" title="Computers">
      <option value="QA-N1">QA-N1</option>
      <option value="QA-N2">QA-N2</option>
    </select>
 </td></tr>
 <tr>
  <td>Keys:</td>
    <td> <input name="Key" type="text" title="Key" />
     <input type="submit" name="Save" id="Save" value="Save"/>
</td>
</tr>
    </form></table>


</body>
</html>

0 Cevap