simple dropdwon search form
5 posts by 2 authors in: Forums > CMS Builder
Last Post: August 2, 2010 (RSS)
By (Deleted User) - August 1, 2010
I am trying to do a simple search form that has a dropdown menu to seach by country. I can't make it works.
This is the page:
http://www.koshertravelinfo.com/minyan/minyan_country.htm
<center><form method="POST" action="http://www.koshertravelinfo.com/minyan/minyan_listing.php"><select>
<option value="">by destination</option>
<option value="USA">USA</option>
<option value="Canada">Canada</option>
</select><input type="submit" name="submit" value="Search Minyan">
</form></center>
Any help will be apreciated.
Re: [RapidWeb] simple dropdwon search form
By Jason - August 2, 2010
The first thing to know is how CMS Builder is storing the country name in the database. Is it storing it as text ("USA","Canada")?
If so, then you're almost there. What you need to do is give your <select> tag a name. If you make this name the same as the name of the field in the table you're doing the search on, CMS Builder should do the search automatically. So, if the field in your table is called "country", you would change your code to this:
<center><form method="POST" action="http://www.koshertravelinfo.com/minyan/minyan_listing.php"><select name="country">
<option value="">by destination</option>
<option value="USA">USA</option>
<option value="Canada">Canada</option>
</select><input type="submit" name="submit" value="Search Minyan">
</form></center>
Hope this helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] simple dropdwon search form
By (Deleted User) - August 2, 2010
2 more questions...
I would like to have a divider in the middle of the drop down menu but the divider should not be a link. I want to group the most common countries on top and then all the rest with a blank divider or maybe a dotted line like this:
USA
Canada
Mexico
---------
Country1
Country2
Country3
Also, I want the search to be a "match" not keyword search like this it will only give exact much.
Re: [RapidWeb] simple dropdwon search form
By Jason - August 2, 2010
For your first question, you can use the <optgroup> tag to put your countries into groups. See this for examples on how to do this:
http://www.w3schools.com/TAGS/tag_optgroup.asp
As for your second question. Even if it's doing a "keyword" search, it will still be pretty exact. The way it works is it would match characters that come either before or after the option you select. For example, if you selected "Canada" and had a country called "Canada - West Coast", it would match this. If you used an "exact" search, it wouldn't.
Hope this helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] simple dropdwon search form
By (Deleted User) - August 2, 2010
Just what I wanted and the labels themselves are not clickable. Maybe when I will have more time I will list them by Continent.