panel visibility java script
<pre><code>&lt;asp:Panel ID="FilterPanel" runat="server" CssClass="FilterBorder" 
                      Visible="false"&gt;
&lt;table width="100%" cellspacing="4"&gt;
        &lt;tr&gt;
            &lt;td class="FilterPanelFilterControlWidth"&gt;
        &lt;Uc:Filter ID="Filter" runat="server" /&gt;
    &lt;/td&gt;
    &lt;td class="CenterInCell"&gt;
        &lt;Controls:BrButton ID="GoButton" runat="server" Text="Go" 
                   CausesValidation="true" SkinID="VerySmallButton" 
                   OnClick="GoButton_Click" /&gt;
    &lt;/td&gt;
    &lt;/tr&gt;
   &lt;/table&gt;
&lt;/asp:Panel&gt;
</code></pre>

<p>i am setting the visibilty of my filter panel as false.. by default..</p>

<p>on the click of show/hide filter i want to change it to <code>visible = true</code>.
this i am doing by javascript..like this</p>

<pre><code>function showHideFilter() {
    if (document.getElementById('ctl00_ContentPlaceHolder1_ctl00_FilterShowHideHiddenField').value == 'true') {
        document.getElementById('ctl00_ContentPlaceHolder1_ctl00_FilterPanel').style.display = 'none';
        document.getElementById('ctl00_ContentPlaceHolder1_ctl00_FilterPanel').style.visibility = 'hidden';
        document.getElementById('ctl00_ContentPlaceHolder1_ctl00_FilterShowHideHiddenField').value = 'false';
        return false;
    }
    else {
        document.getElementById('ctl00_ContentPlaceHolder1_ctl00_FilterPanel').style.display = 'inline';
        document.getElementById('ctl00_ContentPlaceHolder1_ctl00_FilterPanel').style.visibility = 'visible';
        document.getElementById('ctl00_ContentPlaceHolder1_ctl00_FilterShowHideHiddenField').value = 'true';
        return false;
    }
}
</code></pre>

<p>however becaus ethe visible is set to false.. i get  runtime error like this
required object is set to null..below..</p>

<pre><code>document.getElementById('ctl00_ContentPlaceHolder1_ctl00_FilterPanel').style.display = 'inline';

document.getElementById('ctl00_ContentPlaceHolder1_ctl00_FilterPanel').style.visibility = 'visible';
</code></pre>

<p>where am i going wrong..!!</p>
