救命啊!选择radio的时候怎么响应不同的东西 我有两个radio,下面有动态增加行内容的一个表格。我想做的效果是:当我选中其中一个的时候,只显示跟这个radio有关的内容,应该怎么弄? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 onClick = "alert(this.value)" 忘了贴了: <input type="radio" id="kind0" name="kind" value="0" /> 收入 <input type="radio" id="kind1" name="kind" value="1" /> 支出 <table bgcolor="#eeeeff" width="60%" border="1"> <tr> <th width="15%"> 序号 </th> <th width="20%"> 收支类型 </th> <th width="25%"> 类型名称 </th> <th width="30%"> 备注 </th> <th width="10%"> </th> </tr> <c:forEach items="${type}" var="item" varStatus="s"> <tr class="kind${item.kind }"> <td width="15%" align="center"> ${s.count} </td> <td width="20%" align="center"> <c:choose> <c:when test="${item.kind==0}"> 收入 </c:when> <c:otherwise> 支出 </c:otherwise> </c:choose> </td> <td width="25%" align="center"> ${item.typeName} </td> <td width="30%" align="center"> <c:choose> <c:when test="${empty item.re}"> 无 </c:when> <c:otherwise> ${item.re } </c:otherwise> </c:choose> </td> <td width="10%" align="center"> <a href="deleteType?id=${item.typeId }" onclick="return confirm('确定删除?')">删除</a> </td> </tr> </c:forEach> </table>再帮我看看 <input type="radio" id="kind0" name="kind" value="0" onclick="document.forms[0].submit();" /> 收入 <input type="radio" id="kind1" name="kind" value="1" onclick="document.forms[0].submit(); /> 支出 <table bgcolor="#eeeeff" width="60%" border="1"> 这容易啊,加两个<span>:<script>function aaa(n){ var o1=document.getElementsByName(''cainiao0); var o2=document.getElementsByName(''cainiao1); o1.style.display=n==0?"":"none"; o2.style.display=n==0?"none":"";}</script><input type="radio" id="kind0" name="kind" value="0" onclick="aaa(this.value);" />收入<input type="radio" id="kind1" name="kind" value="1" onclick="aaa(this.value);" />支出。 <tr><td><span name='cainiao0' style="display:''"></span><span name='cainiao1' style="display:'none'"></span></td></tr>............ 或者,也可以在window.onload()里AJAX回来全部数据,组成JSON,再写到相应的<td></td>里。加上刷新,三种方法都可以 如何实现在一个页面内存储数据另一个页面读取数据,不是传参,页面也都是静态HTML的 JS高手进来帮忙研究一下~~~~~ 怎么把json的数据给数组 求助!!js多个radiobutton只能选择一个的写法 有关日期转换方面的问题?急急急!!! jQ插件问题 有没有日历程序的源码? 取下拉菜单的值,语句怎么写? 头疼的日期问题,请进 下面的javascript代码中,如何改动才能使index的值是2?(二维数组的难题哦!) javascript脚本怎么一直循环图片? mozilla浏览器无法读取xml文件
忘了贴了:
<input type="radio" id="kind0" name="kind" value="0" />
收入
<input type="radio" id="kind1" name="kind" value="1" />
支出
<table bgcolor="#eeeeff" width="60%" border="1">
<tr>
<th width="15%">
序号
</th>
<th width="20%">
收支类型
</th>
<th width="25%">
类型名称
</th>
<th width="30%">
备注
</th>
<th width="10%">
</th>
</tr> <c:forEach items="${type}" var="item" varStatus="s">
<tr class="kind${item.kind }">
<td width="15%" align="center">
${s.count}
</td>
<td width="20%" align="center">
<c:choose>
<c:when test="${item.kind==0}">
收入
</c:when>
<c:otherwise>
支出
</c:otherwise>
</c:choose>
</td>
<td width="25%" align="center">
${item.typeName}
</td>
<td width="30%" align="center">
<c:choose>
<c:when test="${empty item.re}">
无
</c:when>
<c:otherwise>
${item.re }
</c:otherwise>
</c:choose>
</td>
<td width="10%" align="center">
<a href="deleteType?id=${item.typeId }"
onclick="return confirm('确定删除?')">删除</a>
</td>
</tr>
</c:forEach> </table>再帮我看看
收入
<input type="radio" id="kind1" name="kind" value="1" onclick="document.forms[0].submit(); />
支出
<table bgcolor="#eeeeff" width="60%" border="1">
这容易啊,加两个<span>:
<script>
function aaa(n){
var o1=document.getElementsByName(''cainiao0);
var o2=document.getElementsByName(''cainiao1);
o1.style.display=n==0?"":"none";
o2.style.display=n==0?"none":"";
}
</script>
<input type="radio" id="kind0" name="kind" value="0" onclick="aaa(this.value);" />收入
<input type="radio" id="kind1" name="kind" value="1" onclick="aaa(this.value);" />支出
。
<tr><td><span name='cainiao0' style="display:''"></span><span name='cainiao1' style="display:'none'"></span></td></tr>
............