Jquery and multiple forms on a page

前端 未结 4 2059
[愿得一人]
[愿得一人] 2021-01-17 06:30

I have a several forms that are output from a database on the same page. It works fine when I don\'t use ajax. When I use Jquery it will only work for the first form. Could

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-17 07:07

    Just a note: You can save a lot of time coding if you serialize those forms.

    $('.updateSubmit').live('click', function() {
      $.post("updateGrab.php", $("#yourform").serialize()); 
    }
    

    Source:

    http://api.jquery.com/serialize/

提交回复
热议问题