<?
if($_POST["j_a_name"] != ""){
print_r($_POST);
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<form name="form1" method="post" action="">
<table>
<tr>
<td bgcolor="#e9f0fe" width="21%">续收费内容:</td>
<td width="79%"><select name="j_a_name" onChange="document.all.kk.name=this.options[this.selectedIndex].value;alert(document.all.kk.name)">
<option value="j_a_signdate" selected>系统维护费</option>
<option value="2">维护卡</option>
<option value="j_a_transdate">数据传输费</option>
<option value="4">其它</option>
</select>
</td>
</tr> <tr>
<td bgcolor="#e9f0fe" width="21%"> 合同签订日期:</td>
<td width="79%"><input type="text" id="kk" name="j_a_signdate" class="nb" size="10" onChange="return isDate(this)">
</td>
</tr>
</table>
<input type="submit" name="Submit" value="提交">
</form>
</body>
</html>
if($_POST["j_a_name"] != ""){
print_r($_POST);
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<form name="form1" method="post" action="">
<table>
<tr>
<td bgcolor="#e9f0fe" width="21%">续收费内容:</td>
<td width="79%"><select name="j_a_name" onChange="document.all.kk.name=this.options[this.selectedIndex].value;alert(document.all.kk.name)">
<option value="j_a_signdate" selected>系统维护费</option>
<option value="2">维护卡</option>
<option value="j_a_transdate">数据传输费</option>
<option value="4">其它</option>
</select>
</td>
</tr> <tr>
<td bgcolor="#e9f0fe" width="21%"> 合同签订日期:</td>
<td width="79%"><input type="text" id="kk" name="j_a_signdate" class="nb" size="10" onChange="return isDate(this)">
</td>
</tr>
</table>
<input type="submit" name="Submit" value="提交">
</form>
</body>
</html>
当我选中"数据传输费"时,输入框就变为: <tr id=a2 style="display:none">
<td bgcolor="#e9f0fe" width="21%"> 数据传输开通日期:</td>
<td width="79%">
<input type="text" name="j_a_transdate" class="nb" size="10" onChange="return isDate(this)">
<td>
</tr> </table>
<script>
function a(o)
{
if(o.options[o.selectedIndex].value=="1")
{
a1.style.display=""
a2.style.display="none"
}
else
{
a2.style.display=""
a1.style.display="none"
}
}
</script>
<html>
<head>
</head>
<body>
<script>
function changevalue()
{
if(document.form1.j_a_name.value=="1")
{
DATE_F.innerHTML="系统维护费用<input type='text' name='data_value',value=''>";
}
else if(document.form1.j_a_name.value=="2")
{DATE_F.innerHTML="维护卡<input type='text' name='data_value',value=''>";
}
else if(document.form1.j_a_name.value=="3"){
DATE_F.innerHTML="数据传输费<input type='text' name='data_value',value=''>";
}
else{
DATE_F.innerHTML="其它费用<input type='text' name='data_value',value=''>";
}
}
</script>
<form name="form1" action="#" method="post">
<table>
<tr>
<td bgcolor="#e9f0fe" width="21%">续收费内容:
<select name="j_a_name" onchange="javascript:changevalue()">
<option value=""> -----------</option>
<option value="1" selected>系统维护费</option>
<option value="2">维护卡</option>
<option value="3">数据传输费</option>
<option value="4">其它</option>
</select>
</td>
</tr>
当我选中"系统维护费"时,下面的输入框是
<tr><td><font id="DATE_F">系统维护费用<input type='text' name='data_value',value=''></font> </td></tr>
</table>
</form>
</body>
</html>