ajax

Ajax Autocomplete Textfield for Nodes

function module_name_form() {
  $form = array();
 
  $form['nid'] = array(
    '#title' => t('Nodes'),
    '#type' => 'textfield',
    '#autocomplete_path' => 'example/autocomplete',
   );
 
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Save',
  );
 
  return $form;
}
function module_name_menu() {  
  $items['example/autocomplete'] = array(
    'page callback' => '_module_name_autocomplete',
    'access arguments' => array('access example autocomplete'),
    'type' => MENU_CALLBACK
  );
  return $items;
}