Jquery show div after form post
<p>I have a link on a page that toggles the visibility of a div. The div contains filter options for a form, which is posted. I would like to retain the filter visibility after a post; so if its open before post, it remains open after post.</p>

<p>Here is my script code so far:</p>

<pre><code>$(document).ready(function() {

    // choose text for the show/hide link
    var showText="Show Filter Options";
    var hideText="Hide Filter Options";

    // create the toggle link
    $("#filter-params").before("&lt;p&gt;&lt;a href='#' id='toggle-link'&gt;"+showText+"&lt;/a&gt;");

    // hide the content
    $('#filter-params').hide();

    // capture clicks on the newly created link
    $('a#toggle-link').click(function() {

        // change the link text
        if ($('a#toggle-link').text()==showText) {
            $('a#toggle-link').text(hideText);
        }
        else {
            $('a#toggle-link').text(showText);
        }

        // toggle the display
        $('#filter-params').toggle('slow');

        // return false so any link destination is not followed
        return false;
    });

});
</code></pre>
