Help with radio button and jQuery
Hi,
I’ve a asp.net page with two groups of radio buttons. I want to pop up a modal box when B is selected from 'radio1' radiogroup and 1 is selected from 'radio2' radiogroup. I can pop up modal box when only B is selected from first dropdown box but I don’t know how to check what is selected from both the radiogroups. Can somebody help me with the syntax as I’m new to jQuery syntax. Below is my code.
Thanks in advance,
Joe Green
- $(function () {
$( "#radio1" ).change(function() {
if ($("input[@name='radio1']:checked").val() == 'B') {
if ($("input[@name='radio2']:checked").val() == '1') {
$( "#dialog-modal" ).dialog({width: 500, height:400, modal:true });
$( "#dialog-modal" ).dialog( "open");
}
}
});
- <asp:radiobuttonlist id="radio1" name="radio1" runat="server" RepeatDirection="Horizontal" >
<asp:listitem id="option1" runat="server" value="A" />
<asp:listitem id="option2" runat="server" value="B" />
<asp:listitem id="option3" runat="server" value="C" />
</asp:radiobuttonlist>
- <asp:radiobuttonlist id="radio2" name="radio2" runat="server" RepeatDirection="Horizontal">
<asp:listitem id="option21" runat="server" value="1" />
<asp:listitem id="option22" runat="server" value="2" />
<asp:listitem id="option23" runat="server" value="3" />
</asp:radiobuttonlist>