这是我的代码,为什么点击确定没有反应,本人小白,求帮助,这是网上扒的代码,js表示不太会,只是需要这个功能,求大神教导js怎么把值传过去
<!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>Radio切换效果</title>
</head>
<body>
<style type="text/css">
fieldset{width:378px;border:1px #B0C0D1 solid;padding:10px;}
legend{background:#B0C0D1;padding:4px 10px;color:#fff;}
#c{margin-top:10px;}
.c1,.c2{width:378px;line-height:20px;}
.c1{color:#014CC9;}
.c2{color:#7E6095;}
h3{font-size:16px;padding:5px 0;}
.red{color:#BD0A01;}
</style>
<script type="text/javascript">
function radioShow(){
var myradio=document.getElementsByName("myradio");
var div=document.getElementById("c").getElementsByTagName("div");
for(i=0;i<div.length;i++){
if(myradio[i].checked){
div[i].style.display="block";
}
else{
div[i].style.display="none";
}
}
}
</script>
<form name="ck">
<fieldset>
<legend>修改页面</legend>
<label for="r1" class="red"><input name="myradio" id="r1" type="radio" value="" checked="checked" onclick="radioShow();" />饭店介绍</label>
<label for="r2" class="red"><input name="myradio" id="r2" type="radio" value="" onclick="radioShow();" />菜品介绍</label>
<div id="c">
<div class="c1">
<form action="{:U('Index/modify')}" method="post">
<lable for="attr">
<input type="radio" name="attr" value="特价" >特价
<input type="radio" name="attr" value="金牌" >金牌</lable><br/>
<lable for="name">饭店名称:
<input type="text" name="name" value="{$rest.name}"/>
</lable><br/>
<lable for="id">
<input type="hidden" name="id" value="{$rest.id}"></input>
</lable><br/>
<lable for="type">饭店分类:
<select name="type">
<option value="{$rest.type}">{$rest.type}</option>
<option value="西餐">西餐</option>
<option value="火锅">火锅</option>
</select></lable><br/>
<lable for="phone">电话<input type="number" name="phone" value="{$rest.phone}"/></lable><br/>
<lable for="area">所在区:<select name="area">
<option value="道里区">道里区</option>
<option value="道外区">道外区</option>
<option value="南岗区">南岗区</option>
</select></lable><br/>
<lable for="address">详细地址:<input type="text" name="address"value="{$rest.address}" /></lable><br/>
<lable ><input type="submit" value="确定"/><input type="reset" value="重写" /></lable><br/>
</form>
</div>
<div class="c2" style="display:none;">
<label for="js"><input name="c3" id="js" type="checkbox" value="" />JavaScript</label>
<label for="hd"><input name="c3" id="hd" type="checkbox" value="" />HTML DOM</label>
<label for="dhtml"><input name="c3" id="dhtml" type="checkbox" value="" />DHTML</label>
<label for="vbs"><input name="c3" id="vbs" type="checkbox" value="" />VBScript</label>
<label for="ajax"><input name="c3" id="ajax" type="checkbox" value="" />AJAX</label>
<label for="e4x"><input name="c3" id="e4x" type="checkbox" value="" />E4X</label>
<label for="wml"><input name="c3" id="wml" type="checkbox" value="" />WMLScript</label>
</div>
</div>
</fieldset>
</form>
</body>
</html>
慕的地6079101
一个人的世界k
未必平凡