I am having one of those 'moments' where I am just confused.
I have a form, with a checkbox group. There are 12 checkboxes. They are set up as follows:
<input type="checkbox" id="search_shape1" name="search_shape[]" value="BR" />
<input type="checkbox" id="search_shape2" name="search_shape[]" value="AS" />
etc etc...
Now, instead of submitting them via a submit button, I am using jQuery to pass all the form variables (this form also includes 5 jQuery.ui sliders. The code I am using is below:
$(function() {
$("#epds").bind('submit',function() {
var search_shape = $('#search_shape').val() || [];
$.post('catalog/view/theme/emmaparker/template/information/db_query.php',{search_shape:search_shape}, function(data){
$("#search_results").html(data);
});
return false;
The problem is, on my processing page (db_query.php), it NEVER gets the results of the checkbox. It does get all of the sliders inputs (input type=textbox.. I pulled all of those out of the above code). I have tried pretty much everything, and I am just confused. I have tried putting "search_shape" alone as the name, "search_shape[]" as the name, everything. It just won't pass a value.
On the db_query page, I have tried outputting the value in several ways. I have tried print_r, simple echo, setting a value as an explicit array and then setting that variable to the post result, etc etc etc.
I am at a loss. Can anyone smack me upside the head and let me know what I'm doing wrong? I'm sure it is something simple, like I am not passing the value in the jQuery properly or something.
Thanks, Derek