title: how to call JS function when radiobutton list selected index changed dynamically
body: <p>i have few radio button lists and i need to change the selected index of few lists depending upon other radio button selection so for that i wrote something like below and i am calling some JS function on onclick event,codebehind method on OnSelectedIndexChanged event which are working fine.. </p>
  
  <pre><code>function test(sender) {
              if (sender[0].checked)
              {
                  var controlid = document.getElementById("RadioButtonList1");
                  controlid[0].checked = true;
             }
  
  &lt;asp:RadioButtonList ID="RadioButtonList1" runat="server"
                  RepeatDirection="Horizontal" 
                  OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged" onclick="validate()"&gt;
                  &lt;asp:ListItem &gt;YES&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem &gt;NO&lt;/asp:ListItem&gt;
              &lt;/asp:RadioButtonList&gt;
              &lt;asp:RadioButtonList ID="RadioButtonList2" runat="server" RepeatDirection="Horizontal"&gt;
                  &lt;asp:ListItem onclick="test()"&gt;YES&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem onclick="test()"&gt;NO&lt;/asp:ListItem&gt;
  
              &lt;/asp:RadioButtonList&gt;
  </code></pre>
  
  <p><strong>ISSUE:</strong> if i select YES in RadioButtonList2 then the  RadioButtonList1 value also sets to YES but the functions(validate(),RadioButtonList1_SelectedIndexChanged) whichever am calling from RadioButtonList1 are not being called in this  case..</p>
  
  <p>could you tell me how can i resolve this issue..is there any functionality in jquery or JS to detect indexchange dynamically to call methods.. </p>