I’m using a form to filter weblog entries in the sidebar of a page. The form is setup like this:
<form method="post" name="" id="contact-search" action="{path='contact'}">
<select class="dropdown" name="search:salesrep_region" id="salesrep_region">
<option value="">Select Your State</option>
<option value="Alaska">Alaska</option>
<option value="Alabama">Alabama</option>
...
</select>
<input type="submit" class="submit" id="btn-filter" value="Search" />
</form>The “salesrep_region” is a custom field with a field type of FF Checkbox Group (using the FieldFrame add-on).
Here’s the code where I have the filtered entries displayed:
{exp:weblog:entries weblog="regional_sales_reps" dynamic="off" disable="categories|category_fields|member_data|pagination|trackbacks" dynamic_parameters="search:salesrep_region"}
<h3>{title}</h3>
<p><strong>Phone:</strong> {salesrep_phone}<br />
<strong>Fax:</strong> {salesrep_fax}<br />
<strong>Email:</strong> <a href="mailto:{salesrep_email}">{salesrep_email}</a><br />
{/exp:weblog:entries}The form filters exactly as expected. There’s only one problem:
How can I have nothing displayed by default (on page load)? I only want to display entries AFTER the form is submitted.
Thanks for your help,
Dave