AnsweredAssumed Answered

Query by attribute with multiple inputs

Question asked by thek04 on Sep 6, 2013
Latest reply on Sep 7, 2013 by stevel
I'm trying to run a query on a feature by using multiple inputs fields to preform the search.

I found this example but I can only get it to take one text field as an input. 
<!DOCTYPE html> <html> <head>   <title>State Info</title>   <link rel="stylesheet" type="text/css" href="http://jsdev.arcgis.com/3.6/js/dojo/dijit/themes/claro/claro.css">   <script type="text/javascript" src="http://jsdev.arcgis.com/3.6/"></script>   <script type="text/javascript">     require([       "dojo/ready",       "dojo/on",       "esri/tasks/query",       "esri/tasks/QueryTask",       "dojo/domReady!"], function(ready, on, Query, QueryTask) {       ready(function() {         var myQuery,             myQueryTask;          myQueryTask = new QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5");         myQuery = new Query();         myQuery.returnGeometry = false;         myQuery.outFields = ["STATE_NAME","POP2007","MALES","FEMALES","STATE_ABBR"];          function execute() {           var stateName = dojo.byId('stateName').value;           var stateAbr = dojo.byId('test').value;                      myQuery.text = stateName;           myQuery.text = stateAbr;           myQueryTask.execute(myQuery, showResults);         }          function showResults(myFeatureSet) {           var s = "";           for (var i=0, il=myFeatureSet.features.length; i < il; i++) {             var featureAttributes = myFeatureSet.features[i].attributes;             for (att in featureAttributes) {               s = s + "<strong>" + att + ": </strong>" + featureAttributes[att] + "<br />";             }           }           dojo.byId("info").innerHTML = s;         }         on(dojo.byId("executeButton"), "click", execute);       });     });   </script> </head> <body> <form action="">   US state name :   <input type="text" id="stateName" value="California" />   <input type="text" id="test" value="U" />   <input type="button" id="executeButton" value="Get Details" /> </form> <br /> <br /> <div id="info" class="tundra" style="padding:5px; margin:5px; background-color:#eee;"> </div> </body> </html>

Does anyone have an idea on how to get to take multiple parameters?

Outcomes