根据下拉列表中选择的选项隐藏行
当我在dd(站点上是否有可用的路由器)中选择"no"时,我会得到"是否需要处理新的路由器"下拉列表.现在我想要的是,我在(2)dd中选择"is the Router Make Available from Existing List"这个下拉列表,但它不能工作plz Help.
选择 | 换行 | 行号
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title>Show/Hide</title>
- <script type="text/javascript">
- // <![CDATA[
- function display(obj,id1,id2) {
- txt = obj.options[obj.selectedIndex].value;
- document.getElementById(id1).style.display = 'none';
- document.getElementById(id2).style.display = 'none';
- if ( txt.match(id1) ) {
- document.getElementById(id1).style.display = 'block';
- }
- if ( txt.match(id2) ) {
- document.getElementById(id2).style.display = 'block';
- }
- }
- // ]]>
- </script>
- <script type="text/javascript">
- function display1(obj,id1,id2) {
- txt = obj.options[obj.selectedIndex].value;
- document.getElementById(id1).style.display = 'none';
- document.getElementById(id2).style.display = 'none';
- if ( txt.match(id1) ) {
- document.getElementById(id1).style.display = 'block';
- }
- if ( txt.match(id2) ) {
- document.getElementById(id2).style.display = 'block';
- }
- }
- // ]]>
- </script>
- </head>
- <body>
- <table width="340" cellspacing="0" cellpadding="2">
- <thead>
- <tr>
- <td class="title">Is there a router available at the site :</td>
- <td class="field">
- <select name="type" onchange="display(this,'yes','no');">
- <option>Please select:</option>
- <option value="yes">Yes</option>
- <option value="no">No</option>
- </select>
- </td>
- </tr>
- </thead>
- <tbody id="yes" style="display: none;">
- <tr>
- <td class="title">Make:</td>
- <td class="field"><input type="text" name="make" /></td>
- <td class="title">Model:</td>
- <td class="field"><input type="text" name="model" /></td>
- </tr>
- <tr>
- <td class="title">Sr no:</td>
- <td class="field"><input type="srno" name="make" /></td>
- <td class="title">Accesories/Card:</td>
- <td class="field"><input type="text" name="card" /></td>
- </tr>
- </tbody>
- <tbody id="no" style="display: none;">
- <tr>
- <td class="title"> Does a new Router is required to be processed:</td>
- <td class="field"><select name="info" onchange="display1(this,'yes1','no1');">
- <option value="-1">Select</option>
- <option value="Yes">Yes</option>
- <option value="No">No</option>
- </select></td>
- </tr>
- <tbody id="no1" style="display: none;">
- <tr>
- <td class="title">Is the Router made available from existing stock:</td>
- <td class="field"><select name="stock" >
- <option value="-1">Select</option>
- <option value="Yes">Yes</option>
- <option value="No">No</option>
- </select></td>
- </tr>
- </tbody>
- </tbody>
- </table>
- </body>
- </html>