MVC中的Html.RadioButton的问题?
<tr><th>债权有否担保:</th><td><%=Html.RadioButton("Zqifdanbao","YES",false,new{@id="radbtnY...
<tr>
<th>债权有否担保:</th>
<td>
<%=Html.RadioButton("Zqifdanbao","YES",false, new {@id="radbtnY" })%>是
<%=Html.RadioButton("Zqifdanbao","NO",true, new {@id="radbtnN" })%>否
</td>
<th>担保人姓名:</th>
<td>
<%=Html.TextBox("DbaorenName", null, new { @class = "txtBox char20",@id="danbaoren" })%>
</td>
</tr>
这个是在MVC的框架的代码
我要实现的功能是如果选择<是>就把担保人姓名设置为可读可写,如果是<否>
的话,就把担保人姓名的文本设置为只读状态。
请问高手们 怎么用这个Html.RadioButton 调用。 展开
<th>债权有否担保:</th>
<td>
<%=Html.RadioButton("Zqifdanbao","YES",false, new {@id="radbtnY" })%>是
<%=Html.RadioButton("Zqifdanbao","NO",true, new {@id="radbtnN" })%>否
</td>
<th>担保人姓名:</th>
<td>
<%=Html.TextBox("DbaorenName", null, new { @class = "txtBox char20",@id="danbaoren" })%>
</td>
</tr>
这个是在MVC的框架的代码
我要实现的功能是如果选择<是>就把担保人姓名设置为可读可写,如果是<否>
的话,就把担保人姓名的文本设置为只读状态。
请问高手们 怎么用这个Html.RadioButton 调用。 展开
1个回答
展开全部
<script type="text/javascript" src="../../Scripts/jquery-1.3.2.js"></script>
<script type="text/javascript">
function Setdanbaoren(b) {
$("#danbaoren").attr("disabled", b ? "" : "disabled");
}
</script>
<table>
<tr> <td>
<%=Html.RadioButton("Zqifdanbao","YES",false, new {@id="radbtnY",onclick="Setdanbaoren(true)" })%>是
<%=Html.RadioButton("Zqifdanbao", "NO", true, new { @id = "radbtnN", onclick = "Setdanbaoren(false)" })%>否
</td>
<td>
<%=Html.TextBox("DbaorenName", null, new { @class = "txtBox char20", @id = "danbaoren", disabled = "disabled" })%>
</td>
</tr>
</table>
<script type="text/javascript">
function Setdanbaoren(b) {
$("#danbaoren").attr("disabled", b ? "" : "disabled");
}
</script>
<table>
<tr> <td>
<%=Html.RadioButton("Zqifdanbao","YES",false, new {@id="radbtnY",onclick="Setdanbaoren(true)" })%>是
<%=Html.RadioButton("Zqifdanbao", "NO", true, new { @id = "radbtnN", onclick = "Setdanbaoren(false)" })%>否
</td>
<td>
<%=Html.TextBox("DbaorenName", null, new { @class = "txtBox char20", @id = "danbaoren", disabled = "disabled" })%>
</td>
</tr>
</table>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询