title: HTML input update with ajax
body: <p>We have a db :</p>
  
  <pre><code>ID    Name     Price
  1   product1    200
  2   product2    300
  3   product3    400
  </code></pre>
  
  <p>and my form :</p>
  
  <pre><code>&lt;form action="test.php" method="post" /&gt;
  &lt;input type="text" name="search" id="search" placeholder="enter name product" /&gt;
  &lt;div id="result"&gt;display result form ajax&lt;/div&gt;
  &lt;label&gt;price&lt;/label&gt;
  &lt;input type="text" name="price" id="price" readonly" /&gt;
  &lt;input type="submit" name="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>js file :</p>
  
  <pre><code>// Start Ready
  $(document).ready(function() {  
  
      // Icon Click Focus
      $('div.icon').click(function(){
          $('input#search').focus();
      });
  
      // Live Search
      // On Search Submit and Get Results
      function search() {
          var query_value = $('input#search').val();
          $('b#search-string').html(query_value);
          if(query_value !== ''){
              $.ajax({
                  type: "POST",
                  url: "search.php",
                  data: { query: query_value },
                  cache: false,
                  success: function(html){
                      $("ul#results").html(html);
                  }
              });
          }return false;    
      }
  
      $("input#search").live("keyup", function(e) {
          // Set Timeout
          clearTimeout($.data(this, 'timer'));
  
          // Set Search String
          var search_string = $(this).val();
  
          // Do Search
          if (search_string == '') {
              $("ul#results").fadeOut();
              $('h4#results-text').fadeOut();
          }else{
              $("ul#results").fadeIn();
              $('h4#results-text').fadeIn();
              $(this).data('timer', setTimeout(search, 100));
          };
      });
  
  });
  </code></pre>
  
  <p>when user search name product in search input (we send a ajax request to search.php and display products like that keyword)
  search.php :</p>
  
  <pre><code>connection db and other code...
  if(product) {
  echo '&lt;input type="radio" name="product" id="product" value="'.$result['name'].'" /&gt;'.$result['name'];
  }
  </code></pre>
  
  <p>and user select that,Now how can update price input with the price of the product?</p>