Jquery - Submit all forms by one button

前端 未结 2 1142
臣服心动
臣服心动 2021-01-03 04:46

Html:

..
2条回答
  •  半阙折子戏
    2021-01-03 05:18

    I didn't test it but try this one:

    $("#allsubmit").on("click", function(){
        $('.allforms').each(function(){
            $(this).submit();
        });
    }); 
    

    Note that all of your forms have to have class="allforms" attribute

提交回复
热议问题