title: javascript:insert data from database into html5 text field
body: <p>I am trying to get data from <code>mysql</code> database in a <code>textfield</code> of html page. I am using <code>php</code> to take data from database and using <code>json</code> to give data to <code>javascript</code>. Then using id i am throwing value to <code>textfield</code>. But it is not working. I am easily getting the phone number in <code>div</code> or <code>li</code> tag using id but the same value does not appear in the <code>textfield</code>.</p>
  
  <p>my javascript is like this</p>
  
  <pre><code>$('#tenantcontactTP').live('pageshow', function(event) {
  var id = 'mukul_kuet@yahoo.com';
  $.getJSON('tenantcontact.php?id='+id, displayEmployee);
  });
  
  function displayEmployee(data) {
  var employee = data.item;
  
  if (employee.TenantPhoneNumber) {
      $('#tphone').append(employee.TenantPhoneNumber);
  }
  }
  </code></pre>
  
  <p>Then my html page containing textfield is</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt; 
  &lt;body&gt;
  &lt;div id="tenantcontactTP" data-role="page" data-add-back-btn="true"&gt;
  &lt;div data-role="content"&gt;    
  &lt;ul data-role="listview" data-inset="true"&gt;
  &lt;form&gt;
  &lt;table&gt;
  &lt;tr&gt;&lt;td&gt;Phone Number&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="tphone" id="tphone" value=""/&gt;&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/ul&gt;
  &lt;input type="submit" name="update" value="Update" /&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I will update phone number. Phone number is showing if i use list, but not showing in <code>text field</code>. What can I do?</p>