Filter by entry date in search form
Hi Low..
Is it possible to add in the option of filtering when you search by entry date? so in the below i want to use an option for someone to add a date from/to in...
{exp:low_search:form collection="image-library" search_mode="all" result_page="image-library/search"}
<input type="search" name="keywords" id="keywords" placeholder="keywords / subject / place" />
<input type="text" name="keywords" class="dateinput" placeholder="from mm/yy" />
<input type="text" name="keywords" class="dateinput" placeholder="to mm/yy" />
<input type="search" name="location" placeholder="place - eg:Newcastle" />
<select name="category">
<option value="">All Albums</option>
{exp:channel:categories channel="image-library" style="linear" show_empty="no"}
<option value="{category_id}"{if category_id IN ({low_search_category})} selected="selected"{/if}>
{category_name}
</option>
{/exp:channel:categories}
</select>
<input type="submit" name="submit" value="GO" alt="submit button" class="goarrow" />
{/exp:low_search:form}
Replies
Brian 4 Jun 2013 14:23
Can you not search for other fields within the search form? only on the results page can you filter things down?
Low 4 Jun 2013 14:25
You can, if you use the native start_on and stop_before parameters.
You'd need to make sure the date is formatted as mentioned in the above docs, and use the parameter names as input names:
Brian 4 Jun 2013 14:31
So could you still use a date picker for example on the front end for this? so that users are not having to put in the format YYYY-MM-DD HH:MM ?
Low 4 Jun 2013 14:33
Yes, how you let the user choose the date/time is up to you. As long as the format sent by the form is YYYY-MM-DD HH:MM.