title: PHP auto populate field when pressed tab from one field
body: <p>Apologies for such a silly question but I am new to PHP and Ajax stuff.</p>
  
  <p>I am trying to make one small HTML with two fields.. one id and the other Date of Birth.</p>
  
  <p>What I wish to do is upon entering the id and pressing tab should automatically populate the date of birth.</p>
  
  <p>The date of birth is the truncated string of the id.</p>
  
  <p>Here is what I have made so far..</p>
  
  <p>HTML CODE try.html</p>
  
  <pre><code>    &lt;/head&gt;
      &lt;body&gt;
      &lt;form&gt;
      &lt;tr&gt;&lt;td&gt;Civil ID:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="id"&gt;&lt;/td&gt;
      &lt;/form&gt;
      &lt;td&gt;Date of Birth:&lt;input type="text" name="dob"&gt;&lt;/td&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>PHP id_to_dob.php</p>
  
  <pre><code>    &lt;?php
      $yy = substr($_GET["id"], 1, 2);
      $mm = substr($_GET["id"], 3, 2);
      $dd = substr($_GET["id"], 5, 2);
      $dob = "$dd/$mm/$yy";
      ?&gt;
  </code></pre>
  
  <p>I tried a lot but couldn't get it to work.</p>
  
  <p>Thanks.</p>