title: Dynamically get value of input fields with jQuery and process them with PHP
body: <p>I am working on a page where I show different input fields, depending on the selection that a user did.</p>
  
  <p>Example 1:</p>
  
  <pre><code>&lt;input type="text" name="color" value="" id="5"&gt;
  &lt;input type="text" name="location" value="" id="6"&gt;
  &lt;input type="text" name="age" value="" id="7"&gt;
  </code></pre>
  
  <p>Example 2:</p>
  
  <pre><code>&lt;input type="text" name="color" value="" id="5"&gt;
  &lt;input type="text" name="destination" value="" id="8"&gt;
  &lt;input type="text" name="hours" value="" id="9"&gt;
  &lt;input type="text" name="date" value="" id="10"&gt;
  </code></pre>
  
  <p><strong>Question 1:</strong>
  How can I get all input fields with jQuery when the input fields itself are dynamic?</p>
  
  <p><strong>Question 2:</strong>
  On the serverside, I want to process the input fields with their value and ID. How can I make this dynamic?</p>
  
  <p>I know that this can be done easily when everything is fix, e.g.:</p>
  
  <pre><code>var color =  $('#color').val();
  var destination = $("#destination").val();
  
  var dataString = 'color=' + color + "&amp;destination=" + destination;
  $.ajax({  
         type: "GET",  
         url: "do_something.php",  
         data: dataString,  
         async: false,
         success: function(data){
            console.log('success');
         }
  });
  </code></pre>