I have created a user control which contains RadioButtonList. Based on the RadioButtonList selection a particular
would be visible or hidden. Following is my HTML code:
<body>
<table>
<tr>
<td align="left" valign="middle">
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
Are you the Financial Analyst/Manager responsible for this profit center?
</font>
</td>
<td align="left" valign="middle">
<asp:RadioButtonList ID="RadioButtonListYesNo" runat="server" RepeatDirection="Horizontal" ClientIDMode="Static">
<asp:ListItem Value="1">Yes</asp:ListItem>
<asp:ListItem Value="2">No</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td>
<div id="divFAFMQues" style="visibility:hidden;">
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
Who is the FM/FA of this profit center?
</font>
</div>
</td>
<td>
<div id="divFAFM" style="visibility:hidden;">
<input name="FAFM" type="text" id="TextFAFM" maxlength="20"/>
</div>
</td>
</tr><pre lang="HTML"><pre lang="HTML">
</body>
Following is my javascript code:
<script src="~/Scripts/jquery-1.11.2.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="~/Scripts/jquery-1.11.2.js">
$("[id*=RadioButtonListYesNo]").change(function () {
alert("In Jquery");
var res = $('input[type="radio"]:checked').val();
if (res == '1') {
$("#divFAFMQues").css("visibility", "hidden");
$("#divFAFM").css("visibility", "hidden");
}
else {
$("#divFAFMQues").css("visibility", "visible");
$("#divFAFM").css("visibility", "visible");
}
});
</script>
I have written the jquery function at the bottom of the body, the javascript function is not getting fired. Please help.