jsp頁面中點選(checkbox)或者radio隱藏tr
Rachel_fun發表於2014-04-10
- <html>
- <head>
-
- <title>點選checkbox 隱藏 展現 某行</title>
- <script>
- function changeOracle(){
-
- document.getElementById("oracle1").style.display = (document.getElementById("oracle1").style.display=="")?"none":"";
- document.getElementById("oracle2").style.display = (document.getElementById("oracle2").style.display=="")?"none":"";
- }
-
- </script>
- </head>
- <body>
- <table>
- <tr>
- <td >
- 是否安裝Oracle伺服器:
- </td>
- <td>
- <input type="checkbox" id="oracle" name="oracle" value="1" onclick="changeOracle();" />
-
- </td>
- <td ></td>
- <td ></td>
- </tr>
- <tr id="oracle1" style="display:none;">
- <td >
- Oracle使用者名稱:
- </td>
- <td >
- <input type = "text" name = "oracleUsername"/>
- </td>
- <td>
- Oracle密碼:
- </td>
- <td >
- <input type = "text" name = "oraclePassword"/>
- </td>
- </tr>
- <tr id="oracle2" style="display:none;">
- <td>
- Oracle全域性資料庫名:
- </td>
- <td >
- <input type = "text" name = "oracleDbName"/>
- </td>
- <td ></td>
- <td ></td>
- </tr>
- </table>
- </body>
- </html>