<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form action="" method="get" id="frm" name="myForm">
<select name="mySet" οnchange="showSelectValue(this)">
<option selected="selected" value="lywww">lywww</option>
<option value="lycom">lycom</option>
<option value="lyphp">lyphp</option>
</select>
<br />
<br />
标题1:<input name="text" type="text" style="display:none;" /><br />
标题2:<input name="text" type="text" style="display:none;" /><br />
标题3:<input name="text" type="text" style="display:none;" />
</form>
<script type="text/javascript">
function showSelectValue() {
var textobj = document.getElementsByName('text');
var selectvalue = document.myForm.mySet.value;
if (selectvalue == 'lyphp') {
for (i = 0; i < textobj.length; i++) {
textobj[i].style.display = "block";
}
} else {
for (i = 0; i < textobj.length; i++) {
textobj[i].style.display = "none";
}
}
}
</script>
</body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form action="" method="get" id="frm" name="myForm">
<select name="mySet" οnchange="showSelectValue(this)">
<option selected="selected" value="lywww">lywww</option>
<option value="lycom">lycom</option>
<option value="lyphp">lyphp</option>
</select>
<br />
<br />
标题1:<input name="text" type="text" style="display:none;" /><br />
标题2:<input name="text" type="text" style="display:none;" /><br />
标题3:<input name="text" type="text" style="display:none;" />
</form>
<script type="text/javascript">
function showSelectValue() {
var textobj = document.getElementsByName('text');
var selectvalue = document.myForm.mySet.value;
if (selectvalue == 'lyphp') {
for (i = 0; i < textobj.length; i++) {
textobj[i].style.display = "block";
}
} else {
for (i = 0; i < textobj.length; i++) {
textobj[i].style.display = "none";
}
}
}
</script>
</body>
</html>