sanjeet087
-
Posts
3 -
Joined
-
Last visited
Posts posted by sanjeet087
-
-
these are my page. when i select atleast one option from one group. it works f9.but when i not select any value in any group it give an error. Please Help me out and Sorry for my bad english.INDEX.HTML<!DOCTYPE html><html><head><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script><SCRIPT language="javascript">$(function(){// add multiple select / deselect functionality$("#selectall").click(function () {$('.case').attr('checked', this.checked);});// if all checkbox are selected, check the selectall checkbox// and viceversa$(".case").click(function(){if($(".case").length == $(".case:checked").length) {$("#selectall").attr("checked", "checked");} else {$("#selectall").removeAttr("checked");}});});</SCRIPT></head><body><form action="parse.php" method="post">Choose the items you want:<br><input type="checkbox" id="selectall" name="core[]" checked="checked">All Cores <br><input type="checkbox" name="core[]" class="case" value="2"> Cpu Core 2 <br><input type="checkbox" name="core[]" class="case" value="4"> Cpu Core 4 <br><input type="checkbox" name="core[]" class="case" value="6"> Cpu Core 6 <br>Choose the items you want:<br><input type="checkbox" name="thread[]" value="2"> Cpu Thread 2 <br><input type="checkbox" name="thread[]" value="4"> Cpu Thread 4 <br><input type="checkbox" name="thread[]" value="8"> Cpu Thread 8 <br>Choose the items you want:<br><input type="checkbox" name="ram[]" value="2"> Cpu ram 2 <br><input type="checkbox" name="ram[]" value="4"> Cpu ram 4 <br><input type="checkbox" name="ram[]" value="8"> Cpu ram 8 <br>Choose the items you want:<br><input type="checkbox" name="hdd[]" value="50-100"> 50 to 100 GB <br><input type="checkbox" name="hdd[]" value="100-150"> 100 to 150 GB <br><input type="checkbox" name="hdd[]" value="150-200"> 150 to 200 GB <br><input type="submit" value="Submit Form"></form></body></html>PARSE.PHP<?php$cbArray = $_POST['core'];$cbArray1= $_POST['thread'];$cbArray2= $_POST['ram'];$cbArray3= $_POST['hdd'];$core="";$thread="";$ram="";$hdd="";if(empty($cbArray)){$core=all;} else {$count = count($cbArray);echo("You selected $count items: <br>");for($i=0; $i < $count; $i++){if($i==0){$core=$cbArray[$i];}if($i>0){$core=$core." or ".$cbArray[$i];}}}if(empty($cbArray1)){$thread=all;} else {$count1 = count($cbArray1);echo("You selected $count1 items: <br>");for($i=0; $i < $count1; $i++){if($i==0){$thread=$cbArray1[$i];}if($i>0){$thread=$thread." or ".$cbArray1[$i];}}}if(empty($cbArray2)){$ram=all;} else {$count2 = count($cbArray2);echo("You selected $count2 items: <br>");for($i=0; $i < $count2; $i++){if($i==0){$ram=$cbArray2[$i];}if($i>0){$ram=$ram." or ".$cbArray2[$i];}}}if(empty($cbArray3)){$hdd=all;} else {$count3 = count($cbArray3);echo("You selected $count3 items: <br>");for($i=0; $i < $count3; $i++){if($i==0){$hdd="'$cbArray3[$i]'";}if($i>0){$hdd="$hdd"." or "."'$cbArray3[$i]'";}}}$sql ="select * from server where cpucore=".$core." and cputhread=".$thread." and cpuram=".$ram." and cpuhdd="."$hdd";echo $sql;?>
-
Hello All,
I am a new member on this forum.
i am not a expert, but i want to design a product filter like this image. Please help me in this Issue.
better if available in client side scripting..
Thanks in Advance..
multi checkbox based data filter
in Javascript Help
Posted
Thanks a lot DaveyK and Xaotique for replying on my post.and sorry for my incomplete post. i was not much aware about the forum posting. But it's not really true that i haven't try yet.
i am trying to create a product filter with it's properties. here is the exactly thing that i want to create.
http://meradukan.in/ss/
this filter search fine but load time is too bad. i am looking for a script that can work faster. without submit the form, when we check or unchecked it , result should change.
source code can be download by this link http://meradukan.in/ss/ss.zip
Here is the index page