How to send serialize form data using JQuery if the input element is an array

后端 未结 14 681
庸人自扰
庸人自扰 2020-12-16 15:16

I have this piece of code in my PHP code:

while ($row = mysqli_fetch_assoc($result))
{
    extract($row);
    echo \"\";
    echo \"

        
14条回答
  •  抹茶落季
    2020-12-16 15:51

    You may need to change your PHP as @Tomalak suggests, but you will also need to change your javascript. To reference a named element use the #name selector:

    var selectedbooks = $('form#book_form').serialize();;
    

提交回复
热议问题