Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>How you end it to the server depends on what do you want to archieve. If you want to load a new page, which will process the data, you can use an usual form with hidden inputs. Alternatively, if you want to process is in the background via AJAX, use <code>jQuery.ajax</code> as CRasco said. Either way you use, you need to convert the structured array into a simple key/value list.</p> <p>One option is to generate a JSON document (I don't think jQuery provides a function for this, but you can easily find something) and use a single field with the serialized document. Then on the server side you would use <code>json_decode</code> to get the array back. If you are using the AJAX method, the data option in <code>jQuery.ajax</code> call would contain:</p> <pre><code>{ 'data': '[{"start":"2009/08/01","end":"2009/08/08","comment":"an example date."},...' } </code></pre> <p>A better approach would be to serialize it into a list of fields in a format that PHP natively understands. That means you have to do nothing special, and <code>$_POST['data']</code> will contain the array. For example:</p> <pre><code>{ 'data[0][start]': '2009/08/01', 'data[0][end]': '2009/08/08', 'data[0][comment]': 'an example date.', 'data[1][start]': '2009/07/01', 'data[1][end]': '2009/07/08', 'data[1][comment]': 'another example date, a month earlier.', ... } </code></pre> <p>If you are using the form method, you need to generate input fields like:</p> <pre><code>&lt;input type="hidden" name="data[0][start]" value="2009/08/01" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload