怎么实现这种效果 比如在顶端有一组radio 按钮,横着摆的,下面是一个div 层 层里面有个表单。刚打开这个页面时候 没有radio 按钮被选中 然后层里面的表单显示灰色 就是不可以点。再然后选中任何一个radio 就会显示层里面的不同的表单,同时不刷新页面,就是激活那样。如何实现? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就是代码无从下手啊 可能要用到js 但我不太懂js 刚开始学… 就是代码无从下手啊 可能要用到js 但我不太懂js 刚开始学… <style type="text/css">#lunch_nav, #dinner_nav{ width:50%; overflow:hidden; float:left;}</style><div><div id="lunch_nav"><?php$query="SELECT * FROM DESTINATION WHERE is_lunch='yes'";$result=mysql_query($query);while($get_details=mysql_fetch_array($result)){ $dest_name=$get_details['dest_name'];?> <input type="radio" name="destination_name"/><?php echo $dest_name; ?><?php}?></div><div id="dinner_nav"><?php$query="SELECT * FROM DESTINATION WHERE is_dinner='yes'";$result=mysql_query($query);while($get_details=mysql_fetch_array($result)){ $dest_name=$get_details['dest_name'];?> <input type="radio" name="destination_name"/><?php echo $dest_name; ?><?php}?></div></div><div id="restuarant_list"><!-- 这里面就是一些表单 和 一些饭店的名单, 如何能做到没选上radio按钮时候 这区域内容仅仅显示 但是不能点?然后选上一个之后 这里面功能才能正常显示?--><?php include("include/shop_list.php");?></div> js控制 表单里的内容默认是disabled 选了中以后取消disabled 那如果是表单以外的内容呢?我想把那个include的页面所有的都disable掉 选了radio之后才能正常。 changeForm.html<!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>check</title></head><body><script> function changeForm(param){ document.getElementById("ifr").src = param; }</script><div> <label><input type="radio" name="check" onclick="changeForm('form1.html')" />form1</label> <label><input type="radio" name="check" onclick="changeForm('form2.html')" />form2</label> <label><input type="radio" name="check" onclick="changeForm('form3.html')" />form3</label><br /> <iframe id="ifr" name="ifr" src="" frameborder="0" scrolling="no" style="border:0"></iframe></div></body></html>form1.html<!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><form name="form1" method="post" action=""> <input type="text" name="input" value="form1" /><br /> <input type="button" name="btn" value="submit" /></form></body></html>form2.html<!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><form name="form2" method="post" action=""> <input type="text" name="input" value="form2" /><br /> <input type="checkbox" name="chk" value="2" /> form2<br /> <input type="button" name="btn" value="submit" /></form></body></html>form3.html<!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><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><form name="form3" method="post" action=""> <input type="text" name="input" value="form3" /><br /> <input type="text" name="input1" value="form33" /><br /> <input type="button" name="btn" value="submit" /></form></body></html> 对 我就是差不多这个意思,但是我代码里面不能插入iframe我必须得用<?php include(...)?>把页面加进去 然后根据前面radio的值显示include里面不同内容,该怎么办? 果断Ajax:参考;http://topic.csdn.net/u/20120513/19/6133363b-ea5a-4b36-b719-b0e8483a15e1.htmlhttp://topic.csdn.net/u/20120516/09/dd9c19b5-bbf3-4f1f-bdbb-d58ade236f5f.html "烦人的马甲"请进,还是分类循环的问题 Use of undefined constant name - assumed 'name' in ……的错误,代码如下: CSDN 认证码挂了 来玩游戏,送分 MySQL中如何优化这样的查询: SELECT id, name FROM tab LIMIT 123, 10 求助:如何才能使MYSQL数据库起作用。 PHP与Oracle中文显示不正常问题,在线等待 能不能将要传递的参数当作全局变量 一个企业网站--关于技术问题的论坛,那个好啊? ajax二级联动没法实现 求mssql与mysql不能插入三条以上数据的解答 php 转换 html特殊符号
就是代码无从下手啊 可能要用到js 但我不太懂js 刚开始学…
就是代码无从下手啊 可能要用到js 但我不太懂js 刚开始学…
#lunch_nav, #dinner_nav
{
width:50%;
overflow:hidden;
float:left;
}
</style>
<div>
<div id="lunch_nav"><?php
$query="SELECT * FROM DESTINATION WHERE is_lunch='yes'";
$result=mysql_query($query);
while($get_details=mysql_fetch_array($result))
{
$dest_name=$get_details['dest_name'];
?>
<input type="radio" name="destination_name"/><?php echo $dest_name; ?>
<?php
}
?>
</div>
<div id="dinner_nav">
<?php
$query="SELECT * FROM DESTINATION WHERE is_dinner='yes'";
$result=mysql_query($query);
while($get_details=mysql_fetch_array($result))
{
$dest_name=$get_details['dest_name'];
?>
<input type="radio" name="destination_name"/><?php echo $dest_name; ?>
<?php
}
?>
</div>
</div>
<div id="restuarant_list">
<!-- 这里面就是一些表单 和 一些饭店的名单, 如何能做到没选上radio按钮时候 这区域内容仅仅显示 但是不能点?然后选上一个之后 这里面功能才能正常显示?-->
<?php include("include/shop_list.php");?>
</div>
那如果是表单以外的内容呢?我想把那个include的页面所有的都disable掉 选了radio之后才能正常。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>check</title>
</head><body>
<script>
function changeForm(param){
document.getElementById("ifr").src = param;
}
</script>
<div>
<label><input type="radio" name="check" onclick="changeForm('form1.html')" />form1</label>
<label><input type="radio" name="check" onclick="changeForm('form2.html')" />form2</label>
<label><input type="radio" name="check" onclick="changeForm('form3.html')" />form3</label><br />
<iframe id="ifr" name="ifr" src="" frameborder="0" scrolling="no" style="border:0"></iframe>
</div>
</body>
</html>form1.html<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<form name="form1" method="post" action="">
<input type="text" name="input" value="form1" /><br />
<input type="button" name="btn" value="submit" />
</form>
</body>
</html>form2.html<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<form name="form2" method="post" action="">
<input type="text" name="input" value="form2" /><br />
<input type="checkbox" name="chk" value="2" /> form2<br />
<input type="button" name="btn" value="submit" />
</form>
</body>
</html>form3.html<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<form name="form3" method="post" action="">
<input type="text" name="input" value="form3" /><br />
<input type="text" name="input1" value="form33" /><br />
<input type="button" name="btn" value="submit" />
</form>
</body>
</html>
对 我就是差不多这个意思,但是我代码里面不能插入iframe
我必须得用<?php include(...)?>把页面加进去 然后根据前面radio的值显示include里面不同内容,该怎么办?
参考;
http://topic.csdn.net/u/20120513/19/6133363b-ea5a-4b36-b719-b0e8483a15e1.html
http://topic.csdn.net/u/20120516/09/dd9c19b5-bbf3-4f1f-bdbb-d58ade236f5f.html