title: How to pass multiple textbox value with same id and name to ajax query string
body: <pre><code>&lt;input type="text" name="b_destinations[]" id="title"/&gt;
  &lt;input type="text" name="b_destinations[]" id="title"/&gt;
  &lt;input type="text" name="b_destinations[]" id="title"/&gt;
  &lt;input type="text" name="b_destinations[]" id="title"/&gt;
  </code></pre>
  
  <p>Above is my code as you can see I have multiple textbox with same name and id. now I was using php without the ajax function for submission. Using the foreach and json_encode as this is for the travel booking plan I am saving those value in a single database column. Below is my php code for the query I am using.</p>
  
  <pre><code>foreach($_POST['b_destinations'] as $p_destination) {
      $pdata[] = mysqli_real_escape_string($mysqli,$p_destination);
  }
  $pData[] = $pdata;
  $b_destinations = json_encode($pData);
  </code></pre>
  
  <p>I was saving this form without the ajax but now I am going to use ajax for the submission of the form. how can i pass this multiple textbox value with same name and id to ajax datastring and then post it to my php query</p>