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

By (Deleted User) - August 2, 2010

Works fine now. Thanks a lot.

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: [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.