how to have the input text area as a dual function using jquery?
<p>I hope I can explain this right. This input text area is using autocomplete. So basically, when the enter key is press inside the text area, a decision needs to be made. One decision is when the enter key is pressed after making a selection from the autocomplete list, send this information to function sendSectionA, and the next decision when the enter key is pressed when the data enter into the text area not part of the autocomplete list, send this data to function sendSectionB.</p>

<p>Here is the code....</p>

<pre><code>    &lt;div class="ui-widget"&gt;
      &lt;label for="tags"&gt;Tags: &lt;/label&gt;
        &lt;input id="tags" /&gt;
    &lt;/div&gt;
</code></pre>

<p>var sectionAdata = ["ActionScript","AppleScript","Asp"];</p>

<pre><code>  $( "#tags" ).on('keyup', function(e) {
      if (e.which == 13) alert("send to section B" +this.value);
  }).autocomplete({
      source: availableTags,
      select: function( event, ui ) {
      }
      });
  });
</code></pre>

<p>The problem is when I make a selection from the autocmplete list by hitting the enter key, the send to section B alert gets fired also.</p>
