title: Radio Buttons not checkable
body: <p>My webforms app includes a user control that uses a pair of radio buttons to enable to user to select either "Enter a new task", which causes a text box to display, or "Or select an existing task", which causes a listbox to display.  I use jQuery to show and hide the textbox and listbox and this works with no problem. </p>
  
  <p>My problem is with the radio buttons themselves.  rdoNew always remains checked and rdoExisting unchecked regardless of clicking on either of them, although the two radio buttons have the same GroupName, "NewOrExisting".  My question, of course, is how can I get these radio buttons to behave normally?</p>
  
  <pre><code>&lt;%@ Control Language="VB" AutoEventWireup="false" CodeFile="Pop_Pretask.ascx.vb" Inherits="Pop_Pretask" %&gt;
  </code></pre>
  
  
  
  
  
  
  <pre><code> &lt;a href="#" style="display:none;visibility:hidden;" onclick="javascript:return false" id="hidlinkAddPretask" 
  runat="server"&gt;dummy&lt;/a&gt;
  
  &lt;cc1:ModalPopupExtender ID="mpePretask" runat="server"  PopupControlID="pnlPretask" TargetControlID="hidlinkAddPretask"
       CancelControlID="btnCancelPretask" PopupDragHandleControlID="lblDragHandlePretask"&gt;&lt;/cc1:ModalPopupExtender&gt;
  
  &lt;asp:Panel ID="pnlPretask" runat="server" CssClass="popupPanel" Width="40%"&gt;
  
      &lt;asp:UpdatePanel ID="updPretask" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional"&gt;
         &lt;ContentTemplate&gt;
  
                 &lt;asp:BulletedList ID="blAllPretasks" runat="server"&gt;
                  &lt;/asp:BulletedList&gt;
  
               &lt;asp:HiddenField runat="server" ID="hidPostTaskID" Visible="true" /&gt;
              &lt;asp:HiddenField runat="server" ID="hidGoalID" Visible="true" /&gt;
  
              &lt;h2 runat="server" ID="lblDragHandlePretask" Width="100%"&gt;
                   Before &lt;b&gt;"&lt;asp:Label ID="lblAddPretask" runat="server"&gt;&lt;/asp:Label&gt;"&lt;/b&gt; can be completed, I must:
              &lt;/h2&gt;
  
             **&lt;asp:RadioButton ID="rdoNew" GroupName="NewOrExisting" runat="server" AutoPostBack="false"
                  Text="Enter a new task    " onclick="fnNewPretask();return false;" Checked="true"
                  Enabled="true" /&gt;
             &lt;asp:RadioButton ID="rdoExisting" GroupName="NewOrExisting" runat="server"  AutoPostBack="false"
                  Text="Or select an existing task." onclick="fnExistingPretask();return false;" 
                  Checked="false" Enabled="true" /&gt;**
             &lt;asp:TextBox id="txtNewPretaskName" runat="server" width="100%" Visible="true"/&gt;
             &lt;br /&gt;
            &lt;asp:ListBox ID="lboxPretask" runat="server" Width="100%" Height="200px"
                   AutoPostBack="false"
                   SelectionMode="Single"
                  Style="display:none"
                &gt;
            &lt;/asp:ListBox&gt;
  
         &lt;/ContentTemplate&gt;
          &lt;Triggers&gt;
              &lt;asp:AsyncPostBackTrigger ControlID="btnAddAnotherPretask" EventName="Click" /&gt;
          &lt;/Triggers&gt;
      &lt;/asp:UpdatePanel&gt;
  
      &lt;asp:UpdateProgress ID="UpdateProgress4" runat="server" DisplayAfter="0"&gt;
          &lt;ProgressTemplate&gt;
              &lt;img src="images/progress.gif" alt="" /&gt;&amp;nbsp;Updating...
          &lt;/ProgressTemplate&gt;
  
      &lt;/asp:UpdateProgress&gt;
  
      &lt;br /&gt;
      &lt;asp:Label runat="server" ID="lblErrPretask" Font-Bold="True" ForeColor="Red" /&gt;
  
      &lt;asp:Button ID="btnAddAnotherPretask" runat="server" Text="Save and Add Another" /&gt;
      &lt;asp:Button ID="btnSavePretask" runat="server" Text="Save" /&gt;
      &lt;asp:Button ID="btnCancelPretask" runat="server" Text="Cancel"   OnClientClick="return false;" /&gt;
  
  &lt;/asp:Panel&gt;
  
  &lt;script type="text/javascript"&gt;
  
      function fnNewPretask() {
          //$("#&lt;%=rdoExisting.ClientID%&gt;").attr('checked', false);
          //$("#&lt;%=rdoNew.ClientID%&gt;").attr('checked', true);
          $("#&lt;%=txtNewPretaskName.ClientID %&gt;").show();
          $("#&lt;%=lboxPretask.ClientID %&gt;").hide();
      }
  
      function fnExistingPretask() {
          //$("#&lt;%=rdoNew.ClientID%&gt;").attr('checked', false);
          //$("#&lt;%=rdoExisting.ClientID%&gt;").attr('checked', true);
          $("#&lt;%=txtNewPretaskName.ClientID%&gt;").hide();
          $("#&lt;%=lboxPretask.ClientID %&gt;").show();
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>As the above code shows, the radio buttons are inside a ModalPopupForm which in turn contains an UpdatePanel (which is required so that the listbox can be populated at the server each time the popup is summoned).  These complications may be causing the radio buttons to malfunction.</p>
  
  <p>Thanks in advance for any advice.</p>