title: Search from 7 inputs criteria to look into a json file
body: <p>I'll try to explain.</p>
  
  <p>I have a form with 7 inputs (Age, country, city,...) and in a JSON file i have many people. I need to search into that json file with all the criteria in the form. For example Spain&amp;25years old.</p>
  
  <p>I have the inputs data in an array, but i'm not able or don't know how to compare that criteria and retrieve info from JSON file.</p>
  
  <p>Code below:</p>
  
  <pre><code>    &lt;!-- Google Maps --&gt;
  &lt;script src="assets/js/jquery.ui.map.full.min.js"&gt;&lt;/script&gt;
  &lt;script src="assets/js/jquery.ui.map.extensions.js"&gt;&lt;/script&gt;
  &lt;script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
    $(function(){
      $('#mapa').gmap({'callback': function() {
        var self = this;
        parsejson = function(arrayvalues){
          $.getJSON( 'mapa.json', function(data) { 
            $.each(arrayvalues, function(x, val) {
              if (val.value !== "") {
                console.log(val.value);
                $.each( data.markers, function(i, marker) {
                  console.log('marker ' + marker);
                  // PROBLEM IS HERE, DON'T KNOW HOW TO SOLVE
  
  
  
                });
              };
            });
  
            // Draw markers in map
  
            // $.each( data.markers, function(i, marker) {
            //   self.addMarker({ 
            //     'position': new google.maps.LatLng(marker.latitude, marker.longitude), 
            //     'bounds': false
            //   }).click(function() {
            //     self.openInfoWindow({'content': marker.content }, this);
            //   });
            // });
          });
  
        };
  
        self.getCurrentPosition(function(position, status) {
          if ( status === 'OK' ) {
            var clientPosition = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
            self.addMarker({'position': clientPosition, 'bounds': false});
            self.option('center', clientPosition);
            self.option('zoom', 12);
            self.addShape('Circle', { 
              'strokeColor': "#008595",
              'strokeOpacity': 0.8,
              'strokeWeight': 2,
              'fillColor': "#008595",
              'fillOpacity': 0.35,
              'center': clientPosition,
              'radius': 500,
              'clickable': false
            });
          }
          else {
            console.log("else");
            var clientPosition = new google.maps.LatLng(40.463667, -3.74922);
            self.option('center', clientPosition);
            self.option('zoom', 4);
          }
        });
      }});
    });
  
    // Search form actions
    $('#searcher-form').submit(function(e) {
      e.preventDefault();
      var $inputs = $(this).serializeArray();
  
      parsejson($inputs);
    });
  &lt;/script&gt;
  &lt;!-- End of Google Maps --&gt;
  </code></pre>
  
  <p>The JSON file look like this:</p>
  
  <pre><code>{"markers":[
  {
      "fromcountry":"Spain",
      "fromcity":"San Cristóbal de la Laguna",
      "livecountry":"Spain",
      "livecity":"San Cristóbal de la Laguna",
      "age":25,
      "profession":"Diseñador"
      "title":"La Laguna",
      "latitude":28.469294910391532,
      "longitude":-16.329975128173828,
      "content":"Mooola"
  },
  {
      "fromcountry":"Spain",
      "fromcity":"Madrid",
      "livecountry":"Spain",
      "livecity":"Santa Crus de Tenerife",
      "age":30,
      "profession":"Programador"
      "title":"Los Majuelos",
      "latitude":28.44038127509586,
      "longitude":-16.311674416065216,
      "content":"Mooola"
  }
  </code></pre>
  
  <p>]}</p>
  
  <p>The array from the form gives me back this:</p>
  
  <pre><code>Object {name: "regsearchcountry", value: "whatever"}
  Object {name: "regsearchcity", value: "whatever"}
  Object {name: "regsearchlivecountry", value: ""}
  Object {name: "regsearchlivecity", value: "whatever"}
  Object {name: "regsearchagefrom", value: ""}
  Object {name: "regsearchageto", value: "whatever"}
  Object {name: "regsearchprofession", value: ""} 
  </code></pre>
  
  <p>And I need to comare the form fields with some fields in the JSON, not all data. So i need to compare all those form fields with the JSON, and in case one is empty, compare the rest.</p>