search with two drop downs
8 posts by 3 authors in: Forums > CMS Builder
Last Post: October 25, 2011 (RSS)
By petejdg - October 23, 2011
<form method="POST" action="/wilsontrailer.php">
<input type="submit" name="submit" value="Search">
<select name="" id="">
<option value="gooseneck">Gooseneck</option>
<option value="grain">Grain</option>
<option value="livestock">LIvestock</option>
<option value="flatbed">Flatbed</option>
<option value="belt">Belt</option>
</select>
<select name="gooseneck_keyword" id="state">
<option>CHOOSE OPTION</option>
<optgroup label="United States">
<option id="AL" value="AL">Alabama (AL)</option>
<option id="AK" value="AK">Alaska (AK)</option>
<option id="AZ" value="AZ">Arizona (AZ)</option>
<option id="AR" value="AR">Arkansas (AR)</option>
<option id="CA" value="CA">California (CA)</option>....
Wouldn't it be fairly easy to just do a variable on the first select that would be passed into the value of the second?
Re: [petejdg] search with two drop downs
By Dave - October 24, 2011
We don't have any easy code for this, but I think what you are looking for is called "chained selects".
Here's a google link: http://www.google.com/search?q=chained+selects
There's a number of scripts that let you update one select pulldown from another.
Hope that helps!
interactivetools.com
Re: [Dave] search with two drop downs
By petejdg - October 24, 2011
Re: [petejdg] search with two drop downs
By Jason - October 24, 2011
When your form is submitted, are you able to get the values that were selected from your drop down boxes?
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] search with two drop downs
By petejdg - October 24, 2011 - edited: October 24, 2011
Re: [petejdg] search with two drop downs
By Jason - October 25, 2011
When your form submits to wilsontrailer.php, you should have access to two variables inside the $_REQUEST array:
$_REQUEST['trailers']
and
$_REQUEST['trailertypes']
You could then use these to create your search. If the section you're searching against has fields called trailers or trailertypes, this search can be done automatically. If not, you'll need to manually create your WHERE clause.
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] search with two drop downs
By petejdg - October 25, 2011
Re: [petejdg] search with two drop downs
By Jason - October 25, 2011
No problem. If you need some help getting this done, please send an email to consulting@interactivetools.com and we can explore some options for getting this set up for you.
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/