title: Filter json object with multiple form select
body: <p>I have an json object like this:</p>
  
  <pre><code>{"age":"18","50000": "641","100000": "1011","150000": "1391","gender":"female"},
  {"age":"18","50000": "642","100000": "1012","150000": "1392","gender":"male"},
  {"age":"20","50000": "643","100000": "1013","150000": "1393","gender":"male"}
  </code></pre>
  
  <p>Im trying to build a small "calulator" for showing the price based on user-input:</p>
  
  <pre><code>&lt;label for="gender"&gt;Gender&lt;/label&gt;
    &lt;select id="gender" name="gender"&gt;
      &lt;option value="Female"&gt;Female&lt;/option&gt;
      &lt;option value="Male"&gt;Male&lt;/option&gt;
    &lt;/select&gt;
  
  
  &lt;label for="amount"&gt;Amount&lt;/label&gt;
    &lt;select id="amount" name="amount"&gt;
      &lt;option value="50000"&gt;500 00&lt;/option&gt;
      &lt;option value="100000"&gt;1 00000&lt;/option&gt;
      &lt;option value="150000"&gt;1 50000&lt;/option&gt;
    &lt;/select&gt; 
  
  
  &lt;label for="age"&gt;Age&lt;/label&gt;
  &lt;input id="age" name="age" type="text" /&gt;
  </code></pre>
  
  <p>This is the javascript I have tried, but I can't seem to understand how I do the filtering and showing the correct values from the form.</p>
  
  <pre><code>$(document).ready(function () {
  
      //JSON object
      var obj = {"data":
       [
        {"age":"18","50000": "641","100000": "1011","150000": "1391","gender":"female"},
        {"age":"18","50000": "642","100000": "1012","150000": "1392","gender":"male"},
        {"age":"20","50000": "643","100000": "1013","150000": "1393","gender":"male"}
       ]
  
      };
  
  
      //Find the value when form is submitted
      $('#target').submit(function() {
  
          obj.data = jQuery.grep(obj.data, function(element, index){
            return element.age &amp;&amp; element.gender &amp;&amp; element.amount; // retain appropriate elements
  
          });    
  
          //Empty the div
          $('#price-result').empty();
  
          //Show the result in div
          $("#price-result").append("Age: element.age, Gender: element.gender, Amount: element.amount, Price: element.price-from-json");
  
          return false;//Stop page from reloading
  
      });
  
  
  });
  </code></pre>
  
  <p>Anyone got any tips how I can solve this?</p>