An AJAX HTTP request abnormally terminated in autocomplete textbox I have autocomplete textbox which populate the suggestion based on search text.
Steps

User type in search text box
User press enter instead of waiting for AJAX autocomplete to respond

It comes up with the following error.

An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: path/allcontent/autocomplete
StatusText: error
ResponseText:  ReadyState: 4

I read Drupal alerts &quot;An AJAX HTTP request terminated abnormally&quot; during normal site operation, confusing site visitors/editors, but it didn't help.
This is the callback code.
Autocomplete Textbox
function search_user($form) {
        $form['text_usersearch'] = array(
            '#type' =&gt; 'textfield',
            '#title' =&gt; t(''),
            '#autocomplete_path' =&gt; 'searchuser/autocomplete',
            '#size' =&gt; 30,            
            '#attributes' =&gt; array('class'=&gt; array('auto_submit'),'style'=&gt; array('float:left')),
        );
        
$form['submit_user'] = array(
            '#type' =&gt; 'submit',
            '#value' =&gt; t('Find'),
            '#attributes' =&gt; array('class'=&gt; array('submit_user linkbuttonAction'),'style'=&gt; array('float:left;margin-left:10px')),
       
        );

Autocomplete menu register
$items['searchuser/autocomplete'] = array(
     'title' =&gt; 'Autocomplete for User',
     'page callback' =&gt; 'user_autocomplete_search',
     'access arguments' =&gt; array('access content'),  //or whatever permission makes sense
     'type' =&gt; MENU_CALLBACK
      );

Menu callback
function user_autocomplete_search($string) {
        global $user;
        $arrUserMatch = array();
        
        $matchCode = '%'.db_like($string).'%';
        $arrUserTitle = SelectMatchingUserTitle($matchCode,10);            
                  
        foreach ($arrUserTitle as $userId=&gt;$userName)
        {                                         
            $autotext .= check_plain($userName);                       
            $arrUserMatch[$userName] = $autotext;
        }
      
        drupal_json_output($arrUserMatch);        
    }

Form submission handler
function search_user_submit($form, &amp;$form_state) {
   
        $searchval= $form['text_usersearch']['#value'];        
        
        if($searchval=='')
            return;
        else
           drupal_goto('user/'.$searchval); 
}

JavaScript autocomplete
$(window).load(function(){
                Drupal.jsAC.prototype.select = function (node) {                        
                        this.input.value = $(node).data('autocompleteValue');                                               
                        
                        if(jQuery(this.input).hasClass('auto_submit')){
                              this.input.form.submit();                     
                        }};
                              
                
        });
i am using the following code to auto complete the name of the partners (store owners) in a search box in a form to edit a store's detail (not all form elements used are shown here):
the auto_complete call back returns the list of all the partners in the database.
(here one partner owns one store)
you could try and workout something similar:

the submit button links to a submit handler that updates the database.

function partner_store_form($form, &amp;$form_state, $sid = 0) {
      $edit = NULL;  
      if ($sid != 0) {
      $query = db_select('store', 's')
        -&gt;fields('s', array('partner_pid'));
      $query-&gt;leftJoin('partner', 'p', 's.partner_pid = p.pid');
      $query-&gt;condition('s.sid', $sid);
      $query-&gt;addField('p', 'name', 'p_name');
      $edit = $query-&gt;execute()-&gt;fetchObject();
      }
      $form['pid'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; t('Partner Name'),
        '#size' =&gt; 30,
        '#required' =&gt; TRUE,
        '#default_value' =&gt; isset($edit) ? $edit-&gt;p_name . "  [Id:" . $edit-&gt;partner_pid . "]" : '',
        '#maxlength' =&gt; 96,
        '#autocomplete_path' =&gt; 'partner/autocomplete'
      );

      $form['submit'] = array(
        '#type' =&gt; 'submit',
        '#value' =&gt; isset($edit) ? t('Edit') : t('Save'),
        '#submit' =&gt; array('partner_store_form_submit')
      );
    }

    ----------

    $items['partner/autocomplete'] = array(
        'title' =&gt; 'store autocomplete',
        'page callback' =&gt; 'partner_store_autocomplete',
        'access arguments' =&gt; array(CONST_PERM_LIST_PARTNER),
        'type' =&gt; MENU_CALLBACK,
      );

    -----------------

    function partner_store_autocomplete($string) {
      $store = array();
      $query = db_select('partner', 'p');
      $return = $query-&gt;fields('p', array('pid', 'name'))
        -&gt;condition('p.name', '%' . db_like($string) . '%', 'LIKE')
        -&gt;condition('p.remove', 0)
        -&gt;execute();
      foreach ($return as $field) {
        $store[$field-&gt;name . "  [Id:" . $field-&gt;pid . "]"] = check_plain($field-&gt;name);
      }
      if (empty($store)) {
        $store[''] = t('No Such User');
      }
      drupal_json_output($store);
    }