title: Put json return value from ajax in one or more text box
body: <pre><code>$('select[name=\'service_id\']').bind('change', function() {
  
      service_id = $('select[name=\'service_id\']').val();
  
      $.ajax({
  
          url: 'myajaxfile.php&amp;service_id=' +  service_id,
          dataType : 'json',
          success: function(json) {
  
              var max_use = json.max_use;
              var used = json.used;
              var amount = json.amount;
  
              $('input[name=\'max_use\']').val(max_use);
              $('input[name=\'used\']').val(amount);
  
          }
      });
  });
  </code></pre>
  
  <p>Above is my piece of code. All I want is to bind the value from json result which is coming fine to two or more text boxes which is not happening. The json result is like <code>[{"max_use":"0","period":"30","amount":"99"}]</code> which is very correct. On doing an alert to amount it says undefined. Would be great help if point me out what's the problem is? I tried searching on stackoverflow but found no perfect solution that works. Thanks.</p>