日期:2014-05-18  浏览次数:20778 次

radio问题
jsp中放置radio两个控件,选中其中一个则下面字段显示可编辑,如果选中另一个,则下面字段显示不可编辑
这种要怎么判断呢?
例如:
<td   colspan= "5 ">
<input   type= "radio "   name= "INFOCLASS "   value= "a "       onChange= "onChange() ">
            办事处申请   &nbsp;
<input     checked   type= "radio "   name= "INFOCLASS "   value= "b "   onChange= "onChange() ">
            沟通访谈   </td>
    </tr>
如果选中 "办事处申请 "则接着编辑下面的内容
如果选中 "沟通访谈 "则下面内容显示不可编辑状态

------解决方案--------------------
<form action= " " method= "post " name= "add1 ">
<table>
<tr>
<td colspan= "5 ">
<input type= "radio " name= "INFOCLASS " value= "a " onclick= "add1.a.disabled= ' ';add1.b.disabled= 'disabled ' ">
<input name= "a " value= "办事处申请 " disabled> &nbsp;
</tr> <tr>
<input checked type= "radio " name= "INFOCLASS " value= "b " onclick= "add1.b.disabled= ' ';add1.a.disabled= 'disabled ' ">
<input name= "b " value= "沟通访谈 "> </td>
</tr>
</table>
</form>
------解决方案--------------------
<form name= "form1 ">
<td colspan= "5 ">
<input type= "radio " name= "INFOCLASS " value= "a " onChange= "javascript:form1.ms.disabled= ' ' ">
办事处申请 &nbsp;
<input type= "radio " name= "INFOCLASS " value= "b " onChange= "javascript:form1.ms.disabled= 'true ' ">
沟通访谈
<textarea name= "ms " value= " " > </textarea>
</td>
</form>