title: Populate a form after submit with jQuery and ajax from
body: <p>I have a basic HTML form and want to preform a lookup with Ajax via a PHP file after filling in the first field, looking in an external feed for the values of the two second fields. </p>
  
  <pre><code>&lt;form method="post" action="#"&gt; 
   &lt;input name="number" type="text" id="number" value="" /&gt;
   &lt;input name="name" type="text" id="name" value="" /&gt;
   &lt;input name="email" type="text" id="email" value="" /&gt;
   &lt;button type"submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>After filling in the first field (number), I want to do an Ajax call to a PHP file (submitting the filled in value) and look for the values of the two other fields (name and email). After the lookup fill in the found values in this form, user can edit if wanted and then submit. </p>
  
  <p>The PHP file looks like this: </p>
  
  <pre><code>&lt;?php 
    $number = $_GET["number"];
    $url = "http://api.domain.com/lookup/$number";
    $response = json_decode(file_get_contents($url), true);
  ?&gt;
  </code></pre>
  
  <p>And will give a json response like this</p>
  
  <pre><code>{
      "name": "jacob",
      "email": "jacob@domain.com"
  }
  </code></pre>
  
  <p>Now I need jQuery to complete this task (call the PHP script and populate the other form fields) and that's where I got stuck. Ideas?</p>