JQuery deferred with .each()

后端 未结 2 1746
醉酒成梦
醉酒成梦 2020-12-28 23:46

Any ideas how you might use JQuery\'s deferred methods with a function that detects all changed forms and submits each one as an Ajax post?

I can get the same thing

2条回答
  •  执念已碎
    2020-12-29 00:16

    Delegating the change event to the form fields could solve your problem here.

    $('form').delegate('input[type=text], input[type=radio], select', 'change', 
    function(evt){
        // your submits here
        console.log('changed!')
    });
    

提交回复
热议问题