title: Get value of JSON object with inner objects by HTML form field name without eval
body: <p>I have a problem like this <a href="https://stackoverflow.com/questions/2552836/convert-an-html-form-field-to-a-json-object-with-inner-objects">Convert an HTML form field to a JSON object with inner objects</a> but in to the other direction.</p>
  
  <p>This is the JSON Object response from the server:</p>
  
  <pre><code>{
      company : "ACME, INC.",
      contact : {
          firstname : "Daffy", 
          lastname : "Duck"
      }
  }
  </code></pre>
  
  <p>And this is the HTML form:</p>
  
  <pre><code>&lt;form id="myform"&gt;
      Company: &lt;input type="text" name="company" /&gt;
      First Name: &lt;input type="text" name="contact.firstname" /&gt;
      Last Name: &lt;input type="text" name="contact.lastname" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And this is the (pseudo)code:</p>
  
  <pre><code>var aFormFields; 
  
  for (var i = 0, iMax = aFormFields.length; i &lt; iMax; i++) {
  
      var sFieldName = aFormFields[i].getAttribute('name');
      eval("sFieldValue = oResponse."+sFieldName);
  
  }
  </code></pre>
  
  <p>Ok my solution works, but i looking for a good way to remove the evil eval from the code.
  And the solution should also work for form fields with any count of dots in the field name.</p>