Low Search - Combine date fields
I have 6 select fields on my form which I am trying to use as a date range filter: dayfrom, monthfrom, yearfrom and dayto, monthto, yearto.
I am only trying to filter a list of entries but cannot work out how to pass the correct dates to the results page (filtering by entry_date) I can see I need a range (or range-from, range-to) but am a bit stuck on how to achieve this.
Any help gratefully received.
Best
Alex
Replies
Low 5 Sep 2014 06:37
I would recommend you use javascript for this: add a hidden input field with the correct name, and set the value on submit of the form, based on the selection of the different date fields.
You could also use an extension on the low_search_pre_search hook, looking for those date fields and setting the range parameters internally based on those values.
Alex Cooke 5 Sep 2014 19:11
Appreciate the pointer - worked well. (javascript)
Best