title: AJAX text input value from php function
body: <p>If I got something like</p>
  
  <pre><code>&lt;form name="myform" method="POST"  action=""&gt;
  &lt;input type="text" name="mail"&gt;
  &lt;input type="text" name="firstname"&gt;
  &lt;input type="text" name="lastname"&gt;
  &lt;input type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I got a php function that returns me an array with the full name when its given the email such as:</p>
  
  <pre><code>function get_fullname($email){
  //some code here that gives a value to $firstname, 
  //$lastname, $age and $gender (for example using a cURL request)
  
  $fullname = array(
  firstname =&gt; $firstname, 
  lastname=&gt;$lastname, 
  age=&gt;$age, 
  gender=&gt;$gender);
  
  Return $fullname;
  }
  </code></pre>
  
  <p>So if, for example, my address is john.doe@gmail.com</p>
  
  <pre><code>$fullname['firstname'] =  "John"
  $fullname['lastname'] = "Doe"
  </code></pre>
  
  <p>The question is: <strong>How can I make those names as the <code>value</code> of my <code>text input</code> after the user as typed the email address?</strong></p>