title: display value from database into HTML input tag
body: <p>I have a drop down list (HTML Select tag) and a HTML form under it. As below -</p>
  
  <p>Select-> </p>
  
  <pre><code>&lt;select name="select-native-1" id="select-native-1" onChange="dbToForm(this)"&gt;
            &lt;option value="1"&gt;Employee 1&lt;/option&gt;
            &lt;option value="2"&gt;Employee 2&lt;/option&gt;
            &lt;option value="3"&gt;Employee 3&lt;/option&gt;
            &lt;option value="4"&gt;Employee 4&lt;/option&gt;
          &lt;/select&gt;
  </code></pre>
  
  <p>Form -> </p>
  
  <pre><code>&lt;form&gt;
          &lt;label for="e_name"&gt;Name&lt;/label&gt;
          &lt;input name="e_name" id="e_name" value="" type="text" data-theme="a"&gt;
          &lt;label for="date"&gt;Date&lt;/label&gt;
          &lt;input name="date" id="date" value="" type="date" data-theme="a"&gt;
          &lt;label for="gender"&gt;Gender&lt;/label&gt;
          &lt;select name="gender" id="gender" data-role="slider" data-theme="a" data-inline="true"&gt;
            &lt;option value="male"&gt;Male&lt;/option&gt;
            &lt;option value="female"&gt;Female&lt;/option&gt;
          &lt;/select&gt;
          &lt;label for="address"&gt;Address&lt;/label&gt;
          &lt;textarea name="address" id="address" value="" type="text" data-theme="a"&gt;&lt;/textarea&gt;
          &lt;br&gt;
          &lt;br&gt;
          &lt;label for="image"&gt;Add Image&lt;/label&gt;
          &lt;input name="image" id="image" value="" type="file" data-theme="a"&gt;
          &lt;br&gt;
          &lt;br&gt;
          &lt;label for="multimedia"&gt;Add Multimedia&lt;/label&gt;
          &lt;input name="multimedia" id="multimedia" value="" type="file" data-theme="a"&gt;
          &lt;br&gt;
          &lt;br&gt;
          &lt;input value="Submit" data-role="button" type="submit"&gt;
  </code></pre>
  
  <p></p>
  
  <p>When I select a value from the Select tag, the expected functionality is, based on the selected item's ID, values from the database are retrieved. Am doing this retrieval with the help of PHP embedded in a JS function.</p>
  
  <p>Javascript --></p>
  
  <pre><code>function dbToForm(id) {
  var id_val = id.value;
  var name = '';
  var url = "http://localhost:81/PG_crud_experiment1/retrieve.php?id="+id_val; 
  $.getJSON(url, function(json) {
                 $.each(json, function(i,v) {    
  
                   name += v.name;   
                   alert (name);
  
                  });
                           $("#e_name").html(name);   
         });
  
  };
  </code></pre>
  
  <p>Here, I am able to get the values from the DB to my JS function and store it in a variable. That variable has to be pushed to my HTML form field.
  <code>#e_name</code> is an <code>&lt;input&gt;</code> tag and I am unable to display the retrived value in that field.
  There is a <code>&lt;textarea&gt;</code> and the value prints there without any problem.</p>
  
  <p>Is this a limitation for <code>&lt;input&gt;</code> tag? If yes, what can be used as alternate for the  tag?</p>
  
  <p>Please Note: Values retrieved into my form are for edit and Update purposes. i.e. Values populated in the form can be edited and updated into database.</p>