<div class="grid--cell fl1 lh-lg">
<div class="grid--cell fl1 lh-lg">
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, <a href="/help/reopen-questions">visit the help center</a>.
</div>
</div>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2013-01-10 15:29:37Z" class="relativetime">7 years ago</span>.</div>
</div>
</aside>
First time I am trying to use jquery ajax in my php code. I have a collection of checkboxes. According to my checked checkboxes, the mysql query will be built and it will be showing in my page. Could you please help me how to go forward?
Thanks.
</div>
Look at the manual jQuery.ajax()
. There you have several examples as well.
You must collect your checkboxes values and then send that to your PHP script
var cb1 = $('#checkbox1').attr('checked');
var cb2 = $('#checkbox2').attr('checked');
$.ajax({ type: 'POST',
url: 'checkboxes.php',
data: { checkbox1: cb1,
checkbox2: cb2 },
success: function(response) {
// do something with response from PHP script
}
});
See the jQuery API for more options you can use.
On the server side, you evaluate the $_POST
variable as with any other request.