title: JQuery: Autocomplete form submitting
body: <p>I'm trying to use the jQuery Autocomplete function to submit a form when an item has been selected or an enter has been pressed upon selection. using PHP, Javascript and HTML.</p>
  
  <p>I'm trying to figure out what I'm doing wrong as I am not that experienced in javascript or jQuery. I've searched this site and others for solutions and they all do not seem to work on my code. I'm probably doing something wrong and can't seem to figure out what.</p>
  
  <p>This is the script</p>
  
  <pre><code>&lt;script&gt;
      $(function() {
          var availableproducts = [ &lt;?php echo $tag_list; ?&gt; ];
          $( "#products" ).autocomplete({
              source: availableproducts,
              select: function(event, ui) { 
                  $("#products").val(ui.item.value);
                  $("#partno_item_form").submit(); }
          });
  
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>This is the form and the input field related to #products</p>
  
  <pre><code>echo '&lt;form method="POST" name="partno_item_form"&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input id="products" name="item_select" class="autocomp"&gt;
              &lt;/td&gt;
        &lt;/form&gt;
  </code></pre>
  
  <p>Your assistance in troubleshooting this issue is greatly appreciated!</p>
  
  <p>Thanks in advance</p>