title: Run a javascript function when a hidden input is changed by a radio button selection
body: <p>I am having difficulty with getting a javascript function to run once the selection of a radio button is selected.  I probably am just missing one little thing or maybe more.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Place a title here.&lt;/title&gt;
  &lt;meta charset="utf-8"&gt;
      &lt;script src="js\utilities.js"&gt;&lt;/script&gt;
      &lt;script src="js\backgroundworker.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="master"&gt;
  &lt;form action='' method="post" id="LoginForm"&gt;
          &lt;div style='text-align: center'&gt;
              &lt;div&gt;&lt;label&gt;Please pick a poulation size: &lt;/label&gt;&lt;/div&gt;
              &lt;div style="width: 33%; float:left;"&gt;&lt;label for="small"&gt;Small&lt;input type="radio" name="PopulationSize" id="small" value="small" onclick="document.getElementById('checked_radio').value=this.value;" /&gt;&lt;/label&gt;&lt;/div&gt;
              &lt;div style="width: 33%; float:left;"&gt;&lt;label for="medium"&gt;Medium&lt;input type="radio" name="PopulationSize" id="medium" value="medium" onclick="document.getElementById('checked_radio').value=this.value;" /&gt;&lt;/label&gt;&lt;/div&gt;
              &lt;div style="width: 33%; float:left;"&gt;&lt;label for="large"&gt;Large&lt;input type="radio" name="PopulationSize" id="large" value="large" onclick="document.getElementById('checked_radio').value=this.value;" /&gt;&lt;/label&gt;&lt;/div&gt;
              &lt;input type="hidden" id="checked_radio" name="checked_radio" value="" /&gt;
          &lt;/div&gt;  
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have a standard javascript utilities to discovery and shorthand functions.</p>
  
  <pre><code>function Bobsalert(){
  // get the value of the hidden text
  var checked_radio = U.$("checked_radio");
  //call alert popup
  window.alert("change detected value is: "  + checked_radio);
  }
  
  window.onload = function (){
  
  if(U.$("checked_radio") !== null) {
  U.addEvent(U.$('checked_radio'),'onchange', Bobsalert);
  }
  }
  </code></pre>
  
  <p>Thank you ahead of time for any help on this.  I just seem to be stuck.</p>