title: Use asp:HiddenField value in JavaScript on page load?
body: <p>I'm trying to use the value of an asp:HiddenField control in javascript after postback and pageload.I tried something like this but it does not work.(the get function works fine but I cant seem to make "hidVal" get the value from the asp:HiddenFIeld)</p>
  
  <pre><code>&lt;script type="text/javascript" language="javascript"&gt;
  
  var hidVal=document.getElementById("&lt;% =hidField.ClientID %&gt;").value;
  
  function Get(checbox)
  {   
  
    if(checbox.checked)hidVal += 1;
          else hidVal -= 1;
  
  
    document.getElementById("&lt;% =hidField.ClientID %&gt;").value = hidVal.toString();
  
  }
  </code></pre>
  
  <p></p>
  
  <p>Basicly I'm trying to get the value of a hidden field , increment it on every checked checkbox(using javascript) and reasign the incremented value to the hidden field on every postback.
  If you have any idea on how to make this work please help.</p>
  
  <p>Thanks for the time.</p>