Hey guys,
I'm in a little over my head on what I want to accomplish for this last item on my to do list for a site I'm developing.
I created a single (auto) filter for my site as seen here:
http://gt6.somee.com
If you select a country, it will automatically filter all items under that sql column. The same is true for Drivetrain and all the other options on the left there. What I want to do is add a filter button so you can choose 2 or more options to filter by at once, instead of picking one and it filters immediately. All of this derives from my search.asp page, so when you select a filter it routes you to the search.asp page, which is how I'd prefer to have it (but I'm flexible :))
Currently, I'm using a Javascript to do the filtering and I just need help with doing multiple filters with the button. So far, it only filters the last item in the function. Any suggestions?
Here's the code:
<script language="javascript" type="text/javascript" >
<!
function jumpto(x) {
if (document.form1.jumpmenu1.value != "null") {
document.location.href = x
if (document.form2.jumpmenu2.value != "null") {
document.location.href = x
if (document.form3.jumpmenu3.value != "null") {
document.location.href = x
if (document.form4.jumpmenu4.value != "null") {
document.location.href = x
if (document.form5.jumpmenu5.value != "null") {
document.location.href = x
}
}
}
}
}
}
// end hide
</script>
<script language="javascript" type="text/javascript" >
function DoAllThese() {
jumpto(document.form1.jumpmenu1.options[document.form1.jumpmenu1.options.selectedIndex].value);
jumpto(document.form2.jumpmenu2.options[document.form2.jumpmenu2.options.selectedIndex].value);
jumpto(document.form3.jumpmenu3.options[document.form3.jumpmenu3.options.selectedIndex].value);
jumpto(document.form4.jumpmenu4.options[document.form4.jumpmenu4.options.selectedIndex].value);
jumpto(document.form5.jumpmenu5.options[document.form5.jumpmenu5.options.selectedIndex].value);
}
</script>
<form name="form6">
<input type="button" onclick="DoAllThese();" value="Filter"></input>
</form>
Any suggestions on getting this sorted out so I can filter more than just one item with the filter button?
Thanks for your time guys!
Jerome