0

I can already post form data and input data to my .php file using Jquery and ajax post. But some of my fields have multiple fields with the same name. And ajax will not post the data as an array which i require in order to access all field data.

Short example

<form>
    <input name="myinput1" type="text" /> <!-- Input without same name --!>
    <input name="myinput2" type="text" />
    <input name="myinput[]" type="text" /><!-- Input with same name --!>
    <input name="myinput[]" type="text" />
    <input name="file" type="file" /> <!-- Input for file  --!>
</form
charlietfl
  • 170,828
  • 13
  • 121
  • 150
Stewart
  • 21
  • 4
  • 2
    Why are you using many fields by the same name? – BeetleJuice Jul 17 '16 at 11:29
  • 1
    Possible duplicate of [jQuery Ajax POST example with PHP](http://stackoverflow.com/questions/5004233/jquery-ajax-post-example-with-php) –  Jul 17 '16 at 11:30
  • The user can add a field on by clicking a button with dynamically loads another filed i know how to access the filed array via php but jquery i do not when i access it thought jquery it gives me the index no and not the data – Stewart Jul 17 '16 at 11:32

0 Answers0