Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:

SQL
<script language="javascript" type="text/javascript" >
<!--    hide

    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
Posted
Updated 6-Nov-12 6:26am
v6
Comments
Sergey Alexandrovich Kryukov 31-Oct-12 17:48pm    
Javascript? HTML? ASP.NET? Tag all what applies, specify your programming language, format the code properly, clarify all you have to, etc.
--SA

My apologies SA, I forgot to select the SQL code tags. I can't add a tag for 'filter' but I added SQL and html tags as well.

Jerome
 
Share this answer
 
I updated the question. I am hoping I can just get assistance with the Javascript to get multiple filters working.


Jerome
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900