Javascript does not take hidden text box value?
<p>I am using this javascript function to show different popups if location count varies. Here the txthiddenloccount value is null if the txtbox's visibility is false. If the visibility is true, it works fine. What strange is this??? Can someone help me out. </p>

<pre><code>function isPageValid()
{
var validated = Page_ClientValidate('groupProfile');
var loccount = document.getElementById("ctl00_ContentPlaceHolder1_txthiddenloccount").value;
if(validated)
{
   if(loccount == '1') 
   {
     var mdlPopup = $find('&lt;%= ModalPopupExtendersavechanges.ClientID %&gt;');
     if(mdlPopup)
     {
       mdlPopup.show();           
     }
  }
   else
   {
      var mdlPopup = $find('&lt;%= ModalPopupExtenderMerchantUpdate.ClientID %&gt;');

      if(mdlPopup)
      {
         mdlPopup.show();           
      }
  }
}
}
</code></pre>
