search with two drop downs

8 posts by 3 authors in: Forums > CMS Builder
Last Post: October 25, 2011   (RSS)

Re: [petejdg] search with two drop downs

By Dave - October 24, 2011

Hi petejdg,

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!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] search with two drop downs

By petejdg - October 24, 2011

Dave, I was able to get the select drop downs working correctly with your link. Thanks. Now my dilemma is how to actually make the search work correctly, but I don't even know if it can. I thought this would be fairly simple but seems definitely not. Since it is pulling my list - I can't tell any of the form variables. I don't know if anyone can help or how bad of a custom job this would be?

Re: [petejdg] search with two drop downs

By Jason - October 24, 2011

Hi,

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

Good question. Since they aren't populating the the html I don't know. But I am pretty sure it won't work as the value of the main select is being set - I assume that has to be a variable to pull in my search params like "gooseneck_keyword". I am attaching the files but in the wilsontrailersearch.php the coding is:<select name="trailertypes" style="width:160px;"></select> and I assume the trailertypes has to be one of my trailer searches with _keyword???

Re: [petejdg] search with two drop downs

By Jason - October 25, 2011

Hi,

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

Thanks... but I don't really know php so I think this is now way over my head.

Re: [petejdg] search with two drop downs

By Jason - October 25, 2011

Hi,

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/