title: I hit the ENTER key on keyboard and page refreshes. How do I prevent this and still use the keyboard to search?
body: <p>We used to be able to enter a search field, address on search box, hit the ENTER key on the keyboard and get the search results.</p>
  
  <p>I made several changes but can't pinpoint the change that resulted in the ENTER key misbehaving. Instead of submitting, it refreshes the page.</p>
  
  <p>I have tried each of the following to stop the page refresh:</p>
  
  <pre><code>&lt;form onSubmit="return false;"&gt;
  
  &lt;form onkeypress="return event.keyCode != 13"&gt;
  </code></pre>
  
  <p>Each works.</p>
  
  <p>However, I can no longer hit the ENTER key and have results displayed.</p>
  
  <p>What do I need to do to fix this?</p>
  
  <p>Below is the js:</p>
  
  <pre><code>function getData()
  {
  
       dijit.byId("advanceSearchDialog").hide(); 
      var form = document.getElementById("searchForm");
      var form2 = document.getElementById("featuresForm")
      var searchText = form.searchBox.value.replace(/-/g,"");
      form.searchBox.value = searchText;
  
      if (searchText != "") 
      {
          // collect features to search for:
          var features = [ ];
          var featTypes = form2.featType;
          for ( var f = 0; f &lt; featTypes.length; ++f )
          {
              if ( featTypes[f].checked ) features.push( featTypes[f].value );
          }
          featureList = "'" + features.join("','") + "'";
  
          searchMsg("Searching for '" + searchText + "' ...");
          featureID = "";
          var accord = dijit.byId("accordianContainer");
          var resultsPane = dijit.byId("resultsPane");
          accord.selectChild(resultsPane,true);
          doGlobalSearch( searchText, featureList );
      }
      else
      {
        searchMsg("No search criteria entered, enter search text");
      }   
  }
  
  
  function searchKey(e){
      // special case for IE to capture &lt;enter&gt; in the search box
      var key = window.event ? e.keyCode : e.which;
      var keychar = String.fromCharCode(key);
      if (key == 13)
        getData();
  }
  
  
  
  &lt;form id="searchForm" class="search_field" method="get" action=""&gt;
     &lt;input name="searchBox" id="searchBox" value="" /&gt;
    &lt;button type="button" onclick="getData()"&gt;&lt;img src="images/magnifying_glass.png" alt="Search" /&gt;&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Thanks</p>