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

Hi!

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

Hi,

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: [RapidWeb] simple dropdwon search form

By Jason - August 2, 2010

Hi,

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

Thank you for your help! I listed the most popular countries on top of the drop down list with a label called 'Pouplar countries' and then listed all countries in alphabetical order with a lable 'All Countries in Alphabetical Order'.

Just what I wanted and the labels themselves are not clickable. Maybe when I will have more time I will list them by Continent.