通過radio 顯示和隱藏

<html>
<head>
<title>My Page</title>
</head>
<body>
<form name="myform" action="http://www.mydomain.com/myformhandler.cgi" method="POST">
<div align="center"><br>
<input type="radio" name="group1" value="Milk"> Milk<br>
<input type="radio" name="group1" value="Butter" checked> Butter<br>
<input type="radio" name="group1" value="Cheese"> Cheese
<hr>
<input type="radio" name="group2" value="Water"> Water<br>
<input type="radio" name="group2" value="Beer"> Beer<br>
<input type="radio" name="group2" value="Wine" checked> Wine<br>
</div>
</form>
</body>
</html> 

另外一種radio用法:

<th>
						<s:label value="審覈結果:"></s:label>
					</th>
					<td>
						<s:radio id="verifySelect" list=" #{'Y':'審覈通過','N':'審覈不通過'} "
							value="'N'" required="true"
							name="componentVerify.verifyResult"
							οnclick="showPane(this.value);"></s:radio>
					</td>

<table id="deptPanel" style="display:none">
                            <tr>
                                <th>
                                    <s:label value="主管單位:"></s:label>
                                </th>

                           </tr>
                            <tr>
                                <th>
                                    <s:label value="權屬單位:"></s:label>
                                </th>

                           </tr>
    </table>


//隱藏頁面的DIV
    function showPane(val){
    if('N' == val){
    document.getElementsById("deptPanel").css('display','none');
    }else{
    document.getElementsById("deptPanel").css('display','block');
    }
  }


實現radio  顯示和隱藏

發佈了25 篇原創文章 · 獲贊 19 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章