title: Fill textbox when click a button according to dropdown selection in php jQuery
body: <p>My process is like this: I have a dropdown menu and text box. When I select an id (unique id) from dropdown and then click submit button want to display corresponding name to text box.</p>
  
  <p>My database fields :</p>
  
  <ol>
  <li><code>id</code> (Auto increment)</li>
  <li><code>AgencyName_id</code> (unique id)</li>
  <li>Name</li>
  </ol>
  
  <p>dispay.html</p>
  
  <pre><code>&lt;select name="agencyID_dwn" class="idLookup_dwn"  id="agencyID_dwn" &gt;
  &lt;option selected&gt;...Select...&lt;/option&gt;
    &lt;?php
    while($row = mysqli_fetch_array($result)){
    ?&gt;
  
     &lt;option value="&lt;?php echo $row['AgencyName_id'];?&gt;"&gt; 
     &lt;?php echo $row['AgencyName_id'];?&gt;&lt;/option&gt;
   &lt;?php
    }
     ?&gt;
      &lt;/select&gt;
          // for input text
          &lt;input type="text" id="testid"&gt;
          // submit button
           &lt;input type="submit" name="lookupSubmit"&gt;
  </code></pre>
  
  <p>dataGet.php</p>
  
  <pre><code>            &lt;?php
              if (isset($_POST["lookupSubmit"])) {
  
              $user_id=$_POST['agencyID_dwn'];
  
               $query = "select * from AgencyHome where AgencyName_id = '$user_id'" ;
          $result=mysqli_query($db, $query);
  
          $data =  mysqli_fetch_assoc($result);
  
         echo json_encode($data);
           exit();
  
         }
  
          ?&gt;
  </code></pre>
  
  <p>myjson.js</p>
  
  <pre><code>           &lt;script src="//code.jquery.com/jquery-1.11.2.min.js"&gt;                &lt;/script&gt;
  &lt;script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"&gt;  &lt;/script&gt;
      &lt;script type="text/javascript"&gt;
        $(document).ready(function(){
  
        $('#agencyID_dwn').change(function(){
  
      var reg_number = $(this).val();
        var data_String;
       data_String = 'reg_number='+reg_number;
      $.post('dataGet.php',data_String,function(data){
        var data= jQuery.parseJSON(data);
  
         $('#testid').val(data.Name);
  
  
            });
         });
        });
  
        &lt;/script&gt;
  </code></pre>
  
  <p>When i click submit button
  I got the database results as array in "dataGet.php".But in textbox did not display the result.Any mistake in my code?</p>