我的意图是能过选择下拉列表框,使用显示不同的文字,同时将提交表单的参数做改变,还请指点代码如下
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript">
<!--
function show_info(num)
{
chg_action="chg_action";
if(num=="火车"
{
document.chg_action.innerHTML="<form name=""form1"" method=""post"" action=""check.asp?add_type=1"">";
document.form1.car_part.style="visibility:hidden";
document.form1.art_part.style="visibility:hidden";
document.form1.train_part.style="visibility:visible";
}
else if(num=="客运"
{
document.chg_action.innerHTML="<form name=""form1"" method=""post"" action=""check.asp?add_type=2"">";
document.form1.car_part.style="visibility:visible";
document.form1.art_part.style="visibility:hidden";
document.form1.train_part.style="visibility:hidden";
}
else if(num=="临时公告"
{
document.chg_action.innerHTML="<form name=""form1"" method=""post"" action=""check.asp?add_type=3"">";
document.form1.car_part.style="visibility:hidden";
document.form1.art_part.style="visibility:visible";
document.form1.train_part.style="visibility:hidden";
}
}
//-->
</script>
</head>
<body>
<span id="chg_action"><form name="form1" method="post" action="check.asp"></span>
<SELECT NAME="select" size="1" onchange="show_info('this.options[this.selectedIndex].value')">
<option value="火车" selected>火车</option>
<option value="临时公告">临时公告</option>
<option value="客运">客运</option>
</SELECT>
<div id="car_part" style="visibility:hidden">car_part</div>
<div id="train_part" style="visibility:visible">train_part</div>
<div id="art_part" style="visibility:hidden">art_part</div>
</form>
</BODY>
</HTML>