Embed autocomplete textfield in a block I'm using the following code to embed an autocomplete field in a block. However the autocomplete process does not execute when I type in input:

function cse_block_info(){
    $blocks = array();
    $blocks['cse_search'] = array(
        'info' =&gt; t('CSE Search'),
    );

    return $blocks;
}

function cse_block_view($delta=''){
    switch ($delta) {
        case 'cse_search':
            // The subject is displayed at the top of the block. Note that it
              // should be passed through t() for translation. The title configured
              // for the block using Drupal UI supercedes this one.
              $block['subject'] = t('Title CSE block');
              // The content of the block is typically generated by calling a custom
              // function.
              $block['content'] = cse_block_content($delta);
            return $block;

        break;

        default:
        break;
    }

}

function cse_block_content($which_block){
    switch ($which_block) {
        case 'cse_search':
            $form['cse_search'] = array(
                '#title' =&gt; t('CSE Autocomplete TEST!'),
                '#type' =&gt; 'textfield',
                '#autocomplete_path' =&gt; 'cse/google/autocomplete',
            );

            // Adds a simple submit button that refreshes the form and clears its
            // contents. This is the default behavior for forms.
            $form['submit'] = array(
                '#type' =&gt; 'submit',
                '#value' =&gt; 'Save',
            );

            return $form;
        break;

        default:
        break;
    }
}


I implement the same code as a stand alone system i:e not placed inside a block and the process works flawlessly.

Can anyone help with suggestions of why my attempt to place an autocomplete in a block does not work?
Your block content should look like this:

function cse_block_content($which_block){
  switch ($which_block) {
    case 'cse_search':
      drupal_render(drupal_get_form('my_custom_form'));
    break;

    default:
    break;
  }
}

function my_custom_form($form, &amp;$form_state) {
  $form['cse_search'] = array(
      '#title' =&gt; t('CSE Autocomplete TEST!'),
      '#type' =&gt; 'textfield',
      '#autocomplete_path' =&gt; 'cse/google/autocomplete',
  );

  // Adds a simple submit button that refreshes the form and clears its
  // contents. This is the default behavior for forms.
  $form['submit'] = array(
      '#type' =&gt; 'submit',
      '#value' =&gt; 'Save',
  );

  return $form;
}