Searching with Checkboxes
By Paul
0/5 based on 0 votes. The median rating is 0.
By Paul
Sometimes you want to let people search by checking boxes (for example, checking the options they want with a product). This is possible as of WSN version 5.1.24.
Open your advanced search template (Admin Panel -> Templates -> Manage Templates -> "Advanced Search") or whichever template you're constructing a search form in. For a checkbox search for a multiple checkbox (or multiple selector) field, place this in the search form HTML:
Replace 'multicheck' with the name of your field and the numbers one through three with the possible values of your field. You can extend this to any number of options.
For a checkbox search for a single checkbox field (just on or off), use this HTML:
Replace 'singlecheck' with the name of your field.
Open your advanced search template (Admin Panel -> Templates -> Manage Templates -> "Advanced Search") or whichever template you're constructing a search form in. For a checkbox search for a multiple checkbox (or multiple selector) field, place this in the search form HTML:
<input type="hidden" name="multicheckcondition" value="or" />
multicheck: <input type="checkbox" name="multichecksearch[]" value="one" /> one <input type="checkbox" name="multichecksearch[]" value="two" /> two <input type="checkbox" name="multichecksearch[]" value="three" /> three
multicheck: <input type="checkbox" name="multichecksearch[]" value="one" /> one <input type="checkbox" name="multichecksearch[]" value="two" /> two <input type="checkbox" name="multichecksearch[]" value="three" /> three
Replace 'multicheck' with the name of your field and the numbers one through three with the possible values of your field. You can extend this to any number of options.
For a checkbox search for a single checkbox field (just on or off), use this HTML:
<input type="hidden" name="singlecheckcondition" value="=" />
<input type="checkbox" name="singlechecksearch" value="singlecheck" /> singlecheck
<input type="checkbox" name="singlechecksearch" value="singlecheck" /> singlecheck
Replace 'singlecheck' with the name of your field.
Rating:
0/5 based on 0 votes. The median rating is 0.
Submitted: 03/02/10 (Edited 03/13/10)
Description: Adding custom field searches to the advanced search page that use checkboxes to search.
Views:
110 views. Averaging 0 views per day.
In the most recent 30 day period, there've been 5 views.

Print
E-Mail