title: Returning multiple PHP echo value to JQuery ajax in multiple textfields
body: <p>Here is my Php File in which I will return two echoes via jquery ajax</p>
  
  <pre><code>&lt;?php
  $data=$_POST['data1'];
  $data2="h";
  if($data2==$data)
  {
   echo "john";
   echo "usa";
  }
  else
  {
   echo "Error";
  }
  ?&gt;
  </code></pre>
  
  <p>This is where I call it with ajax and set the name and location to text fields</p>
  
  <pre><code>&lt;input type="text" id="name"&gt;
  &lt;input type="text" id="location"&gt;
  &lt;button id="submit"&gt;Click&lt;/button&gt;
  
  &lt;script&gt;
      $(document).ready(function() {
          $("#submit").click(function() {
              var a = "h";
              $.ajax({
                  url: "test.php",
                  method: "POST",
                  data: {
                      data1: a
                  },
                  success: function(response) {
                      alert(response);
                  }
              });
          });
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Now I want that John will display in the name field and the USA will display in the location field</p>