NAME='auto_complete_form'; $form->METHOD='POST'; $form->ACTION=''; $form->debug='error_log'; $form->AddInput(array( 'TYPE'=>'text', 'ID'=>'location', 'NAME'=>'location', 'LABEL'=>'Location', 'ACCESSKEY'=>'L', 'VALUE'=>'', 'ExtraAttributes'=>array( 'autocomplete'=>'off', 'title'=>'Type just the first letters of a location.', ) )); $form->AddInput(array( 'TYPE'=>'button', 'NAME'=>'show_locations', 'ID'=>'show_locations', 'VALUE'=>'...', 'ExtraAttributes'=>array( 'title'=>'Click to show all locations.' ) )); $form->AddInput(array( 'TYPE'=>'custom', 'ID'=>'complete_location', 'NAME'=>'complete_location', 'CustomClass'=>'form_mysql_auto_complete_class', 'CompleteInput'=>'location', 'CompleteMinimumLength'=>1, 'Dynamic'=>1, 'ShowButton'=>'show_locations', "Connection"=>$connection, "CompleteValuesQuery"=>"SELECT name FROM locations WHERE name {BEGINSWITH} ORDER BY name", "CompleteValuesLimit"=>10, 'FeedbackElement'=>'complete_location_feedback', 'SubmitFeedback'=>' ', 'CompleteFeedback'=>' ', 'MenuClass'=>'groovymenu', 'MenuStyle'=>'', 'ItemClass'=>'groovyitem', 'ItemStyle'=>'', 'SelectedItemClass'=>'groovyselecteditem', 'SelectedItemStyle'=>'', )); /* * This code is necessary to handle the requests for fetching * auto-complete values. */ $form->HandleEvent($processed); if($processed) exit; $form->ConnectFormToInput('location', 'ONLOAD', 'Focus', array()); $onload=HtmlSpecialChars($form->PageLoad()); ?>