MultiSearch with dropdowns
2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 12, 2010 (RSS)
Hi,
I have looked high and low through the forum and I just can seem to find a clear answer to this question:
Can you create a multisearch in cmsb using dropdown menus?
i.e. We have a wine site and we want the user to be able to use a search box to narrow down their search so the user selects they type of wine from one dropdown(Red) then he selects the year(1998)from another dropdown then the region(Italy)in another and finally the price($20)from the final dropdown, and the results will only show
- Red wines from 1998 that come from Italy that cost $20. I know the more filters there are the less results will show up but we need the search to work like this. Can this be done? If so is there documentation somewhwere or a template I can work off of. I can usually figure this stuff out myself but this one is a little special. Thanks in advance.
I have looked high and low through the forum and I just can seem to find a clear answer to this question:
Can you create a multisearch in cmsb using dropdown menus?
i.e. We have a wine site and we want the user to be able to use a search box to narrow down their search so the user selects they type of wine from one dropdown(Red) then he selects the year(1998)from another dropdown then the region(Italy)in another and finally the price($20)from the final dropdown, and the results will only show
- Red wines from 1998 that come from Italy that cost $20. I know the more filters there are the less results will show up but we need the search to work like this. Can this be done? If so is there documentation somewhwere or a template I can work off of. I can usually figure this stuff out myself but this one is a little special. Thanks in advance.
Re: [Dan Maitland] MultiSearch with dropdowns
By Dave - January 12, 2010
Hi Dan,
That might look something like the following. Note that I don't know what your fieldnames are so I just guessed and put them in red:
Just make sure your wine prices are saved as numbers only and don't have dollar signs, periods, or commas in them (19.95, not $19.95). Otherwise the database won't be able to match them.
And you can find the search docs online here:
http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html
Hope that helps! Let me know if you have any more questions about that.
That might look something like the following. Note that I don't know what your fieldnames are so I just guessed and put them in red:
<form method="GET" action="/path/to/your/listViewer.php">
Type:
<select name="type">
<option value=""><Any></option>
<option>Red</option>
<option>White</option>
</select><br/><br/>
Year:
<select name="year">
<option value=""><Any></option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
</select><br/><br/>
Region:
<select name="region">
<option value=""><Any></option>
<option>Italy</option>
<option>Chile</option>
</select><br/><br/>
Min Price:
<select name="price_min">
<option value=""><Any></option>
<option value="10">$10</option>
<option value="20">$20</option>
<option value="30">$50</option>
</select><br/><br/>
Max Price:
<select name="price_max">
<option value=""><Any></option>
<option value="10">$10</option>
<option value="20">$20</option>
<option value="30">$50</option>
</select><br/><br/>
<input type="submit" name="submit" value="Search">
</form>
Just make sure your wine prices are saved as numbers only and don't have dollar signs, periods, or commas in them (19.95, not $19.95). Otherwise the database won't be able to match them.
And you can find the search docs online here:
http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html
Hope that helps! Let me know if you have any more questions about that.
Dave Edis - Senior Developer
interactivetools.com
interactivetools.com