How to create a quick search form

The following is a sample Quick Search form for WebFeat Express. The HTML and Javascript below can be embedded in any web page to create a simple search form.

Enter term:
Category:

<html>
<head>
  <title>Quick Search Example</title>
    
  <!-- Generates the category array required by showCategoryBox  -->  
  <script language="JavaScript" Src="http://wfxsearch.webfeat.org/wfsearch/category?Client_ID=10242"></script>  

  <!-- Contains showCategoryBox function  -->  
  <script language="JavaScript" Src="http://wfxsearch.webfeat.org/wfsearch/js?f=wfx"></script>
  
  <script>
  // This function is called during the form submit to set required cookies
  function setForm()
  {
    var sCookieText = '';    
    sCookieText += document.wfform.wf_field1.options[document.wfform.wf_field1.selectedIndex].value + ":";
    sCookieText += document.wfform.wf_term1.value + ":";    
    document.cookie = 'wf_search_structure=' + encodeURIComponent(sCookieText) + '; Path=/';      
    document.cookie = 'wf_selected_databases=' + 
      document.wfform.Databases.options[document.wfform.Databases.selectedIndex].value + '; Path=/';
  }
  </script>
    
</head>

<body>
    
  <form name="wfform" action="http://wfxsearch.webfeat.org/wfsearch/search" method="POST">
    
    <!-- The following hidden fields are required to search WebFeat  -->
    <input type="hidden" name="Command" value="Search">
    <input type="hidden" name="Client_ID" value="10242">
    <input type="hidden" name="rtmpl" value="wfx_ui2.jsp">    
    <input type="hidden" name="format" value="JS">    
    <input type="hidden" name="wf_all_years" value="yes">    
    <input type="hidden" name="wf_codeset" value="utf-8">  
    <input type="hidden" name="noserial" value="1">

    <!-- The QuickSearch page supports 1 search term and 1 field with no operators -->
    Enter term:    
    <input type="text" name="wf_term1" size="20" value="">
        
    <select name="wf_field1" size="1">
      <option value="wf_all">All</option>
      <option value="wf_keyword" selected>Keyword</option>
      <option value="wf_title">Title</option>
      <option value="wf_author">Author</option>
      <option value="wf_abstract">Abstract</option>
      <option value="wf_subject">Subject</option>
    </select>
    <br/><br/>

    <!-- Displays the category box -->
    Choose category:
    <Script Language="Javascript">
      showCategoryBox("Databases", "All Resources");
    </Script>
    <br/><br/>    
    
    <input type="submit" value="Search" onClick="setForm();">
  </form>  
</body>
</html>