0

Not sure if its simply something I'm doing incorrectly, but following the documentation with the following form:

<form method="post" action="{path='events/search_results'}">
    {exp:super_search:search}
    <fieldset>
        <div class="datepicker-container">
            <span class="icon icon-calendar-1"></span>
            <input class="datepicker" type="text" name="event_start_date-from" value="{super_search_event_start_date-from}" />
        </div>

        <div class="datepicker-container">
            <span class="icon icon-calendar-1"></span>
            <input class="datepicker" type="text" name="event_start_date-to" value="{super_search_event_start_date-to}" />
        </div>

        <select class="fancyselect" name="category">
            <option value="">Category</option>
            {exp:channel:categories category_group="6" style="linear"}
                {exp:super_search:variables}
                    {if super_search_category == category_id}
                    <option value="{category_id}" selected="selected">{category_name}</option>
                    {if:else}
                    <option value="{category_id}">{category_name}</option>
                    {/if}
                {/exp:super_search:variables}
            {/exp:channel:categories}
        </select>

        <input type="submit" name="submit" class="button" value="Search" />
    </fieldset>
    {/exp:super_search:search}
</form>

The search mechanism works just fine, however on page load it doesn't update each fields' value to reflect what was search. Refreshing the page (or hitting search again) updates this. Not using Ajax or anything, and page reloads fine - the search results are updated properly.

0

Remove the {exp:super_search:search} tag pair from your search form. It's not necessary for the well-functioning of the form.

{exp:super_search:search} is typically used as a way to attempt to retrieve previous values, using cookies, in form fields. This can come in handy in some cases when pressing the "Back" button on your browser to return to a form and hoping it's still filled out. On pages where the search form and results are on the same template, for example, this feature can interfere with the parsing of your form values. {exp:super_search:search} is also useful if you're using search_id="", which is used along with the Searh History feature.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.