下拉列表与输入文本框联动问题,单选按钮与行或列联动问题,单选按钮与下拉列表框连动问题(在线等待)(高分求代码,能实现者给300分)

Foxman110 2003-10-23 02:46:38
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>
<form method=get action=fw.py>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
//在下面这行代码中实现这样的功能,部分下来列表框的选项选中后则显示(目标端口和文本输入框f_dport),部分选项则隐藏(目标端口和文本输入框f_dport),比如,选种了tcp则显示(目标端口和文本输入框f_dport),选中了udp则隐藏(目标端口和文本输入框f_dport)
<tr>
<td width="13%">协议:
<select name=f_proto>
<option value=tcp > TCP</option>
<option value=udp > UDP</option>
<option value=icmp > ICMP</option>
</select>
</td>
<td width="87%">目标端口:
<input name=f_dport type=text size=5></td>
</tr>
//下面这行代码实现这样的功能,单选按钮处于选中状态则显示列(起始时间,结束时间,星期),非选中状态则隐藏列(起始时间,结束时间,星期)
<tr>
<td width="13%"><input type="radio" value="V1" checked name="R1">
时间限制:</td>
<td width="87%">起始时间:
<input name=f_timestart onClick="alert('hi')" type=text size=4>
结束时间:
<input name=f_timestop type=text size=4>
星期:
<input type=checkbox name=f_day[] value=1>一
<input type=checkbox name=f_day[] value=2>二
<input type=checkbox name=f_day[] value=3>三
<input type=checkbox name=f_day[] value=4>四
<input type=checkbox name=f_day[] value=5>五
<input type=checkbox name=f_day[] value=6>六
<input type=checkbox name=f_day[] value=7>日
</td>
</tr>
//下面这样代码实现这样的功能,单选按钮处于选中状态则显示下拉列表框(f_flag),非选中状态则隐藏下拉列表框(f_flag)
<tr>
<td width="13%"><input type="radio" name="R1" value="V2">
连接标志:
</td>
<td width="87%"><select name=f_flag >
<option value='NEW'>NEW
<option value='REL'>RELATED
<option value='EST'>ESTABLISHED
</select>
</td>
</tr>
<tr>
<td width="13%"></td>
<td width="87%"></td>
</tr>
<tr>
<td width="13%"></td>
<td width="87%"></td>
</tr>
</table>
</center>
</div>
</form>
</body>
</html>
以上代码一旦实现,马上给分,先谢谢大家的帮忙
...全文
218 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
roymand 2003-10-23
  • 打赏
  • 举报
回复
主要是用onclick事件来控制css的图层的显示或隐藏
mapletree 2003-10-23
  • 打赏
  • 举报
回复
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<script>
function checkTcp(who){
if(who=="tcp"){
document.forms[0].f_dport.parentElement.style.display="";
}else{
document.forms[0].f_dport.parentElement.style.display="none";
}
}
function checkTime(){
if(document.forms[0].R1[0].checked){
document.forms[0].f_timestart.parentElement.style.display="";
document.forms[0].f_flag.style.display="none";
}else{
document.forms[0].f_timestart.parentElement.style.display="none";
document.forms[0].f_flag.style.display="";
}
}
</script>
</head>

<body>
<form method=get action=fw.py>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
//在下面这行代码中实现这样的功能,部分下来列表框的选项选中后则显示(目标端口和文本输入框f_dport),部分选项则隐藏(目标端口和文本输入框f_dport),比如,选种了tcp则显示(目标端口和文本输入框f_dport),选中了udp则隐藏(目标端口和文本输入框f_dport)
<tr>
<td width="13%">协议:
<select name=f_proto onchange="checkTcp(this.options(this.selectedIndex).value)">
<option value=tcp > TCP</option>
<option value=udp > UDP</option>
<option value=icmp > ICMP</option>
</select>
</td>
<td width="87%">目标端口:
<input name=f_dport type=text size=5></td>
</tr>
//下面这行代码实现这样的功能,单选按钮处于选中状态则显示列(起始时间,结束时间,星期),非选中状态则隐藏列(起始时间,结束时间,星期)
<tr>
<td width="13%"><input onclick="checkTime()" type="radio" value="V1" checked name="R1">
时间限制:</td>
<td width="87%">起始时间:
<input name=f_timestart onClick="alert('hi')" type=text size=4>
结束时间:
<input name=f_timestop type=text size=4>
星期:
<input type=checkbox name=f_day[] value=1>一
<input type=checkbox name=f_day[] value=2>二
<input type=checkbox name=f_day[] value=3>三
<input type=checkbox name=f_day[] value=4>四
<input type=checkbox name=f_day[] value=5>五
<input type=checkbox name=f_day[] value=6>六
<input type=checkbox name=f_day[] value=7>日
</td>
</tr>
//下面这样代码实现这样的功能,单选按钮处于选中状态则显示下拉列表框(f_flag),非选中状态则隐藏下拉列表框(f_flag)
<tr>
<td width="13%"><input onclick="checkTime()" type="radio" name="R1" value="V2">
连接标志:
</td>
<td width="87%"><select name=f_flag style="display:none" >
<option value='NEW'>NEW
<option value='REL'>RELATED
<option value='EST'>ESTABLISHED
</select>
</td>
</tr>
<tr>
<td width="13%"></td>
<td width="87%"></td>
</tr>
<tr>
<td width="13%"></td>
<td width="87%"></td>
</tr>
</table>
</center>
</div>
</form>
</body>
</html>

87,988

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧