using a variable set from a <form>

412
3
01-02-2012 10:56 AM
evanpicard
New Contributor II
building from the example here:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/find/find_map_datagrid.html

I have a dropdown menu, to create a variable.  My intention is to be able to search on more than one feature class/"find task"

Here is the code from within <body> for the dropdown menu:

       <div id="rightPane" dojotype="dijit.layout.ContentPane" region="right">
          <form>
              Search by :
              <select id="myList" onchange="searchQual()">
                <option></option>
                <option>District</option>
                <option>Division</option>  
              </select> 
              <p><input type="text" id="searchQualVal" size="0"></p> 
          </form>
   Search Value: <input type="text" id="searchVal" size="10" value="1068"/>
          <button data-dojo-type="dijit.form.Button"  data-dojo-props='onClick:function(){ doFindFunc();}, value:"Search"'>
             Search
          </button>


and im trying to use the values "searchQual" and "searchQualVal" to here:
      function doFindFunc() {
        //Set the search text to the value in the box 
        findParams.searchText = dojo.byId("searchVal").value;
        //it never gets into this switch
        switch (searchQualVal){  
        case "District":
          findDistrict.execute(findParams,showResults);
          break;
        case "Division":
          findDivision.execute(findParams,showResults);
          break;
        };
      };
      


please help!
Thank you.
0 Kudos
3 Replies
JeffPace
MVP Alum
building from the example here:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/find/find_map_datagrid.html

I have a dropdown menu, to create a variable.  My intention is to be able to search on more than one feature class/"find task"

Here is the code from within <body> for the dropdown menu:

       <div id="rightPane" dojotype="dijit.layout.ContentPane" region="right">
          <form>
              Search by :
              <select id="myList" onchange="searchQual()">
                <option></option>
                <option>District</option>
                <option>Division</option>  
              </select> 
              <p><input type="text" id="searchQualVal" size="0"></p> 
          </form>
   Search Value: <input type="text" id="searchVal" size="10" value="1068"/>
          <button data-dojo-type="dijit.form.Button"  data-dojo-props='onClick:function(){ doFindFunc();}, value:"Search"'>
             Search
          </button>


and im trying to use the values "searchQual" and "searchQualVal" to here:
      function doFindFunc() {
        //Set the search text to the value in the box 
        findParams.searchText = dojo.byId("searchVal").value;
        //it never gets into this switch
        switch (searchQualVal){  
        case "District":
          findDistrict.execute(findParams,showResults);
          break;
        case "Division":
          findDivision.execute(findParams,showResults);
          break;
        };
      };
      


please help!
Thank you.


dojo.byId("searchQualVal").value;
0 Kudos
evanpicard
New Contributor II
YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!
Thank you.
took a little more tweaking, but it works now.
Thank you.
thank you!
I love these forums.
0 Kudos
JeffPace
MVP Alum
YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!
Thank you.
took a little more tweaking, but it works now.
Thank you.
thank you!
I love these forums.


Agreed.  Glad to help.
0 Kudos