<asp:RadioButtonList ID="RdoBtnHasNotified" runat="server"
RepeatDirection="Horizontal" AutoPostBack="True"
OnSelectedIndexChanged="RdoBtnHasNotified_SelectedIndexChanged">
<asp:ListItem Value="1">Yes</asp:ListItem>
<asp:ListItem Value="0" Selected="True">No</asp:ListItem>
</asp:RadioButtonList></td>
<asp:TextBox ID="TxtHowNotified" runat="server" TextMode="MultiLine" MaxLength="100"></asp:TextBox></td>
答案 0 :(得分:0)
这应该可以解决问题:
$('#<%= RdoBtnHasNotified.ClientID =%>').click() {
if ($(this).find('input:checked').val()) == 'Yes' {
$('#idOfYourTextBox').attr('enabled','true');
}
}
答案 1 :(得分:-1)
<asp:RadioButtonList ID="rbl" runat="server" onclick="Toggle()">
<asp:ListItem Value="0">No</asp:ListItem>
<asp:ListItem Value="1">Yes</asp:ListItem>
</asp:RadioButtonList>
<asp:TextBox ID="TextBox1" runat="server" style="display:none" />
JS
<script type="text/javascript">
function Toggle()
{
var radio = document.getElementsByName('<%=rbl.ClientID %>');
var txt = document.getElementById('<%=TextBox1.ClientID %>');
for (var j = 0; j < radio.length; j++)
{
if (radio[j].checked)
{
if(radio[j].value == '1')
{
txt.style.display = '';
}
else
{
txt.style.display = 'none';
}
}
}
}
</script>