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'=>' Looking up for locations ', '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()); ?> Test for Manuel Lemos' PHP form class using the auto-complete plug-in input and MySQL database queries

Test for Manuel Lemos' PHP form class using the auto-complete plug-in input and MySQL database queries


StartLayoutCapture(); $title='Auto-complete plug-in test'; $body_template='form_locations_auto_complete_body.html.php'; include('templates/form_frame.html.php'); $form->EndLayoutCapture(); $form->DisplayOutput(); if($connection) mysql_close($connection); ?>