Query field based on user selection

Discussion created by thebillcarr on Apr 7, 2014
I'm attempting to slap together a "simple" query app that will use a field selected by the user in a drop box to query from a text box.

Somehow my wires are crossed and either my drop box isn't populating the query.where statement or the statement is wrong all together.
<!DOCTYPE html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!--The viewport meta tag is used to improve the presentation and behavior of the samples 
      on iOS devices-->
    <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
    <title>Query State Info without Map</title>

    <script src=""></script>
        "esri/tasks/query", "esri/tasks/QueryTask",
        "dojo/dom", "dojo/on", "dojo/domReady!"
      ], function (Query, QueryTask, dom, on) {

        var queryTask = new QueryTask("Secure service");

        var query = new Query();
        query.returnGeometry = false;
        query.outFields = [

        on(dom.byId("execute"), "click", execute);

        function execute () {
           var sel = dom.byId("input1").value;
            var sss = dom.byId("select").value;
          query.where = "sss = " + sel +"'"; 
          queryTask.execute(query, showResults);

        function showResults (results) {
          var resultItems = [];
          var resultCount = results.features.length;
          for (var i = 0; i < resultCount; i++) {
            var featureAttributes = results.features[i].attributes;
            for (var attr in featureAttributes) {
              resultItems.push("<b>" + attr + ":</b>  " + featureAttributes[attr] + "<br>");
          dom.byId("info").innerHTML = resultItems.join("");

   <select id="select">
  <option value="FIRSTNAME">First Name</option>
  <option value="LAST_NAME">Last Name</option>
  <option value="Service_ID">Service ID</option>
  <option value="TOWNSHIP">Township</option>
    Search :
    <input type="text" id="input1" value="TEXT">
    <input id="execute" type="button" value="Get Details">
    <br />
    <br />
    <div id="info" style="padding:5px; margin:5px; background-color:#eee;">

Any help is appreciated.