title: Getting value of Radio buttons with Master Pages
body: <p>I have an aspx page that uses a master page.  On this page I have a group of radio buttons.  I need to get at the checked property for each of the elements in the radio button group in javascript.  Before the page was converted to use a master page, the following javascript code worked just fine:</p>
  
  <pre><code>if((!f.rblRegUseVehicles[0].checked) &amp;&amp; (!f.rblRegUseVehicles[1].checked))
  {
      isValid = "false";
  }
  </code></pre>
  
  <p>f is the reference to the form.  This worked just fine.</p>
  
  <p>When the page was chanded to use a Master Page, I changed the javascript to the following:</p>
  
  <pre><code>if((!f.&lt;%=rblRegUseVehicles.ClientID%&gt;[0].checked) &amp;&amp; (!f.&lt;%=rblRegUseVehicles.ClientID%&gt;[1].checked))
  {
      isValid = "false";
  }
  </code></pre>
  
  <p>Now, the javascript is failing because it can't find the element.  In the "View Source" I have elements with the name:</p>
  
  <pre><code>&lt;input id="ctl00_cphContent_rblRegUseVehicles_0" type="radio" name="ctl00$cphContent$rblRegUseVehicles" value="Yes" /&gt;
  
  &lt;input id="ctl00_cphContent_rblRegUseVehicles_1" type="radio" name="ctl00$cphContent$rblRegUseVehicles" value="No" /&gt;
  </code></pre>
  
  <p>The only code that works is</p>
  
  <pre><code>document.&lt;%=Form.ClientID%&gt;.&lt;%=rblRegUseVehicles.ClientID%&gt;_0.checked
  </code></pre>
  
  <p>I want the javascript to reference the array like before the page was converted to use a Master Page.  How can I do that?</p>