2013-02-26 80 views

回答

1

这不是用户友好的,但你可以通过这个

$('#checkbox').change(function() { 
    // Is checkbox checked? 
    if ($(this).is(':checked')) { 
     // Send parent form data via post 
     $.post('submission-url.html', $(this).closest('form').serialize(), function(data) { 
      // process response 
     }); 
    } 
}); 

做到这一点,您可以通过$(this).closest('form').attr('action')而不是“提交-url.html”从form元素得到action属性