notrab
notrab

Reputation: 234

submit form using ajaxform on checkbox click

I'm trying achieve what it says in the title.

I'm using jQuery and I have the ajaxForm plugin that is used elsewhere in my App.

The code I have currently is

$('form.date-response input[type=checkbox]').live('click', function(){
    $(this).parent('form').submit();
});

But all it seems to do is submit the form, which works, and does the job but it goes to the action to post it. Unlike other forms, it's not using the ajaxForm() request.

Plugin in discussion is http://jquery.malsup.com/form/#ajaxForm

Upvotes: 0

Views: 951

Answers (1)

notrab
notrab

Reputation: 234

It appears to be very late, I've managed to resolve this quickly if anyone else has similar issues..

$('form.date-response input[type=checkbox]').live('click', function(){
    $(this).parent('form').ajaxForm().submit();
});

Hopefully this is good, and correctly. Please share if anyone has any other solutions.

Upvotes: 1

Related Questions