I have a Jquery that takes the value of a checkbox as soon as it has been checked and then should be hiding a DIV and reloading a .php in that same DIV instead.
So far I just get the script to act once the checkbox is ticked and the DIV to hide, but I can´t get the value of the checkbox passed and neither the DIV loaded...
Here is the code:
FORM:
echo "<input type='checkbox' class='regularCheckbox' name='color' value='".$colorBoxes[color_base1]."' /><font class='similarItemsText'> ".$colorBoxes[color_base1]."</font><br />";
JQUERY:
<script type="text/javascript">
jQuery(document).ready(function($) {
$(":checkbox").bind("click", function (event) {
if($(this).is(':checked'))
{
var color = $(".regularCheckbox").find(':checked').val();
$(".itemMain").hide();
$(".indexMain").load('indexMain.php?color='+color);
}
});
});
</script>
indexMain.php
$color = $_GET['color'];
$items = mysql_query("SELECT * FROM item_descr WHERE color_base1 = '$color'");
My intention is to create a good filtering for my content.
Thanks!!!