Webmastersite.net
Register Log In

Custom field search form

Title Custom field search form
Message Text Edit: This was a question but I figured it out and thought I would post my answer here. I had a little trouble with it so maybe an example similiar to this could make its way into the manual.

I have two new link fields, "Color" and "Size" (examples)

I want a form at the top of each category that allows user to select the appropriate color and size and have all links in the category that match returned on the search page. Notice that they dont actually type in a search term, just select what types of links to display.

I initially wanted to use a filter to do this because it seems more logical, however I could never get a filter to work on a multi selection text field (check boxes or multi-selection drop box) I could only get the filter to work with something that had one answer (drop down selector)

<form action="search.php?action=filter&filled=1" method="post">
<input type="hidden" name="whichtype" value="links">
<input type="hidden" name="incat" value="{CATID}">
<input type="hidden" name="colorcondition" value="like">
<input type="hidden" name="sizecondition" value="like">


<select name="colorsearch">
<option value="">Select Color</option>
<option value="">------</option>
<option value="">Any</option>
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Blue">Blue</option>
</select>


<select name="sizesearch">
<option value="">Select Size</option>
<option value="">------</option>
<option value="">Any</option>
<option value="Small">Small</option>
<option value="Medium">Medium</option>
<option value="Large">Large</option>
</select>


<input type="submit" value="Search"></form>

Rating
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
0/5 based on 0 votes.
Ownership mrowton
Views 624 views. Averaging 0 views per day.
Similar Topics
Submission Date Mar 10, 2006 - 11:22 AM