Sending all input fields with jquery .post()
<p>I have collected the values of all input field into an array as follows:</p>

<pre><code> $( ".formbox" ) . each( function(id,elem){
    form_fields[ "input-" + $( elem ) . attr( "id" )  ] = $( elem ) . val( ); 
   });

 $.log( "Collected:", form_fields );
</code></pre>

<p>This does work, and then I try passing the array using post</p>

<pre><code> $.post(
    "server.php", 
    {
        fields: form_fields
    },
    function(ret) {

       if (!ret.success )
         alert ( "Error! Reload please!" );
       else
       {
       }
    }, 
    'json'
  );
</code></pre>

<p>However while retrieving, Firebug indicates that the fields are empty</p>

<p>As I understood I need to serialize the array or not use it at all. But what could I use instead?</p>

<p>Please tell what is it that I am doing wrong?</p>

<p>---------- added ----------
...I just found this</p>

<pre><code> form_fields = {};
</code></pre>

<p>:)</p>

<p>I don't understand how but that solved the problem
Please tell me what the difference is between an Array and {}? What does {} in JS ?</p>
