Hello,
In my form by which users can create new post items on my site, I would like for them to be able to enter a numerical range, which could then be compared with an associated integer saved to a user's profile to function as a filtering option.
I'm creating a directory site for seed varieties, and the seeds grow best in a defined range of USDA hardiness zones (1-13).
When users fill out the form to add a seed variety to the site, they need to be able to efficiently enter the zone range for the variety. Currently, I have it set up using 13 checkboxes, but that is cumbersome. After doing some research I saw that it's a significant challenge to create a slider input, so my next thought was having two small form fields where they could enter the first and second integer of the range (i.e. Zone Range: [ 3 ] to [ 11 ] ).
The system would then need to understand that the zone range includes all zones from and including 3 to 11 (i.e. understanding that this item belongs to zone 3, 4, 5, 6..... 11, but not 1, 2, 12, or 13)
This information would then need to be available for filtering and sorting items, as users will be able to enter the USDA zone in which they live and garden as a custom user field on their profile. So if User A has Zone 6 saved on their profile, then they'd be able to filter seed variety listings and only show those that include zone 6.
I did see this older thread that briefly touched on what I'm trying to do, but there were no further instructions: https://toolset.com/forums/topic/input-type-range-slider/#post-618444
How would I go about implementing this?
Thanks!
Hello,
You can setup the search field as two input boxes, see below test site:
Login URL:
hidden link
Custom search form with range filter:
hidden link
You just need to choose the filter block setting "USING THIS COMPARISON": Between
See my screenshot range-filter.jpg
It works fine in frontend, for example:
hidden link