通过Java进行多重过滤和按钮帮助 [英] Help With Multiple Filtering And Button Via Javascript
问题描述
大家好,
我对要开发的网站的待办事项清单上的最后一项要完成的工作有些犹豫.
我为网站创建了一个(自动)过滤器,如下所示:
http://gt6.somee.com
如果选择一个国家,它将自动过滤该sql列下的所有项目.对于Drivetrain以及左侧的所有其他选项也是如此.我想要做的是添加一个过滤器按钮,这样您就可以一次选择2个或更多选项进行过滤,而不是选择一个就立即过滤.所有这些都来自我的search.asp页面,因此,当您选择一个过滤器时,它会将您路由到search.asp页面,这就是我希望拥有它的方式(但我很灵活:))
目前,我正在使用Javascript进行过滤,我只需要通过按钮进行多个过滤的帮助即可.到目前为止,它仅过滤函数中的最后一项.有什么建议吗?
代码如下:
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" >
<!-- 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>
关于解决此问题的任何建议,这样我就可以使用过滤器"按钮过滤多个项目?
感谢您的宝贵时间!
Jerome
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
推荐答案
抱歉,我忘了选择SQL代码标签.我无法为过滤器"添加标签,但同时也添加了SQL和html标签.
杰罗姆(Jerome)
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
我更新了问题.我希望我可以在Javascript方面获得帮助,以使多个过滤器正常工作.
杰罗姆(Jerome)
I updated the question. I am hoping I can just get assistance with the Javascript to get multiple filters working.
Jerome
这篇关于通过Java进行多重过滤和按钮帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!