点击复选框,使用ajaxform提交表单 [英] submit form using ajaxform on checkbox click

查看:185
本文介绍了点击复选框,使用ajaxform提交表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我使用jQuery,并且我的应用程序中的其他地方使用了ajaxForm插件。

/ p>

我现在的代码是

pre $ $('form.date ('click',function(){
$(this).parent('form')。submit();
});

但似乎所做的只是提交表单,到发布它的行动。与其他表单不同,它不使用ajaxForm()请求。



讨论中的插件是

>它似乎很晚,如果其他人有类似的问题,我设法解决这个问题。

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

希望这是好的,并且是正确的。如果有人有任何其他解决方案,请分享。


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

解决方案

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.

这篇关于点击复选框,使用ajaxform提交表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆