title: ASP Listbox read by Javascript
body: <p>I am trying to make my ASP:Listbox throw an event in javascript that will pick out the selected item and eventually will use that to choose what to do next. But with anything new, I always try and understand what is going on before I try and make it complex. 
  I am able to get the javascript to connect to the listbox with the </p>
  
  <pre><code>document.getElementByID()
  </code></pre>
  
  <p>and the variable is populated with the items, but when I try and call on one of the items with </p>
  
  <pre><code>listbox.options[#].value 
  </code></pre>
  
  <p>I get this error </p>
  
  <pre><code>"Microsoft JScript runtime error: 'listbox' is undefined" 
  </code></pre>
  
  <p>Please help me figure out why I cant get to the information.</p>
  
  <p>This is just to show a div that contains radio buttons, It is in "var index =" line that the error is occuring.</p>
  
  <pre><code>function showRadios() {
          var listBox = document.getElementById('&lt;%= lbxCheckListLevel3.ClientID %&gt;');
          var index = listbox.options[2].value;
          if (listBox.Options[listBox.Options.SelectedIndex].text != null) {
              var div = document.getElementById("radioDiv");
              div.style.visibility = "visible";
          }
  </code></pre>
  
  <p>Thanks in advance</p>
  
  <p>EDIT:
  Is there any reason that the javascript wouldnt hold the information in the var? It seems that the variable isnt holding its own information. When changing the 2nd line of the code to </p>
  
  <pre><code>var index = listbox
  </code></pre>
  
  <p>I am still getting the same error, and no information is there when I mouse over it during a pause.</p>