function init() { queryTask = new esri.tasks.QueryTask("https://myserver/Locations/MapServer/0"); //initialize query query = new Query(); query.returnGeometry = true; query.outFields = ["*"]; } function executeQueryTask() { //set query based on what user typed in for population; query.where = "QUALIFICAT IN " + QUALIFICAT; //execute query queryTask.execute(query,showResults); } function showResults(featureSet) { //remove all graphics on the maps graphics layer map.graphics.clear(); //Performance enhancer - assign featureSet array to a single variable. var resultFeatures = featureSet.features; //Loop through each feature returned for (var i=0, il=resultFeatures.length; i<il; i++) { //Get the current feature from the featureSet. //Feature is a graphic var graphic = resultFeatures; graphic.setSymbol(symbol); //Set the infoTemplate. graphic.setInfoTemplate(infoTemplate); //Add graphic to the map graphics layer. map.graphics.add(graphic); } } <body> <br/> Qualification Type: <input type="text" id="QUALIFICAT" value="OT" /> <input type="button" value="Get Details" onclick="executeQueryTask(dojo.byId('QUALIFICAT').value);" /> <div id="map"></div> <div id="footer" data-dojo-TYPE="dijit.layout.ContentPane" data-dojo-props="region:'bottom'"> </div>
<input type="button" value="Get Details" onclick="executeQueryTask(dojo.byId('QUALIFICAT').value);" />
function executeQueryTask() { //set query based on what user typed in for population; query.where = "QUALIFICAT IN " + QUALIFICAT; //execute query queryTask.execute(query,showResults); }
function executeQueryTask(QUALIFICAT) { //set query based on what user typed in for population; query.where = "QUALIFICAT IN " + QUALIFICAT; //execute query queryTask.execute(query,showResults); }