title: Clear form field after select for jQuery UI Autocomplete
body: <p>We're using JQuery UI Autocomplete and I'm having problems clearing the textbox containing the search term once the query is complete.  Here is our JQuery code:</p>
  
  <pre><code>$(document).ready(function () {
          $("form#search input#term").autocomplete({
              source: '&lt;%= Url.Action("Display", "Search") %&gt;',
              delay: 200,
              minLength: 3,
              parse: function (data) {
                  var array = new Array();
                  for (var i = 0; i &lt; data.length; i++) {
                      array[array.length] = { data: data[i], value: data[i], result: data[i].link };
                  }
                  return array;
              },
              select: function (event, ui) {
                  window.location.href = ui.item.value;
                  $(this).val() = "";
                  return false;
              }
          });
      });
  </code></pre>
  
  <p>This code works fine in Firefox, but IE 8 is throwing an exception and gives a dialog asking if I want to use the IE Script Debugger.  I saw this Stack Overflow post: <a href="https://stackoverflow.com/questions/2561903/clear-form-field-after-select-for-jquery-ui-autocomplete">Clear form field after select for jQuery UI Autocomplete</a> which says the solution to the problem is to return false from the JQuery select function, but that didn't help.  Anyone have suggestions on how to fix this?</p>