I’ve got a few forms all on the same page, each one has the class .select_form and each one when you click a checkbox on the form sends the selected values via ajax.
What i want to be able to do is to reference the element selected (as there are multiple forms with the same css class) rather than naming each form differently. Ideally i guess i need to reference “this” and pass it around but i’m just not getting anywhere!
$('.select_form input').live("click", function(){
check();
});
function check()
{
$("#ajax_totals").load("/stuff/things", $(".select_form").serializeArray());
}
I guess i want something like:
$('.select_form input').live("click", function(){
check(this);
});
function check(this)
{
$("#ajax_totals").load("/stuff/things", $(this).serializeArray());
}
Yes you can, you can just not use the variable
thissince it is reserved.Other option is using call()