搜索条件的多个复选框 [英] multiple check boxes for search criteria

查看:66
本文介绍了搜索条件的多个复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在为纱丽做一个电子商务项目。在产品页面的项目中,我有很多不同颜色的复选框。如果我选​​中一个复选框,基于相应的产品将被加载到页面上。但我无法检查更多的复选框来搜索product.I需要一个代码来完成此操作。例如,如果我选择2个复选框颜色为蓝色和绿色,仅颜色绿色和蓝色的衣服应该加载到页面。请帮我这样做。请

提前谢谢。

Hello everyone,
I am doing a e-commerce project for sarees.In that project in products page i have many check boxes for different colors.At present if i select one check box,based on that corresponding product will be loaded on to the page.But i am not able to check the more check boxes for searching product.I need a code for accomplishing this.For example if i select 2 check boxes of color blue and green,only sarees of color green and blue should be loaded on to page.Please help me to do this.Please
Thanks in advance.

推荐答案

嗨...

看到这个可能对你有帮助。

http://www.sitepoint.com/forums/showthread.php?1184333-Use-AJAX-to-filter-MySQL- results-with-multiple-checkbox-option [ ^ ]



http://contactform7.com/checkboxes-radio-buttons-and-menus/ [ ^ ]

谢谢你。
Hi...
See this one may helpful to u.
http://www.sitepoint.com/forums/showthread.php?1184333-Use-AJAX-to-filter-MySQL-results-with-multiple-checkbox-option[^]

http://contactform7.com/checkboxes-radio-buttons-and-menus/[^]
Thank u.


      string clr = "";int x=0;
       for (int i = 0; i < chklst_color.Items.Count; i++)
       {
          if (chklst_color.Items[i].Selected ==true)
          {
           x = 1;
           clr = clr + "'" + chklst_color.Items[i].Text + "',";
            }
        }

if(x==1)
{
 clr = clr .TrimEnd(',');
query="select sarees from table where color in ('"+clr +"' )"; 
}





如果有帮助请标记为答案......



if it helps please mark as answer ......


这篇关于搜索条件的多个复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆