How to transfer form data to php using AJAX?

It is necessary to transfer a two-dimensional array (vote []) It is in this snag.

If you transmit like this,

data: { array: $("#form").serialize() } 

That turns out not that:

vote% 5B% 5D = value

 <form id="form"> <input type="text" value="" name="first"> <input type="text" value="" name="second"> <input type="text" value="" name="vote[]"> <input type="text" value="" name="vote[]"> <input type="text" value="" name="vote[]"> <input type="submit" value="Передать в php" name="submit"> </form> 

Push in the right direction. thank

    1 answer 1

    It is not clear a little what is being sent there and how.

     var fd = new FormData(); fd.append('ключ' , *сюда кинь свой массив*); 

    And send the fd object with ajax.