Login Retreive lost passwordRegister
Search

Manual  /  Functions  /  Look & Feel  /  SetAutoComplete

SetAutoComplete
SetAutoComplete (
string $field
array $options
)

Arguments:

Name Description
$field The textfield where you want to set some autocomplete options for.
$options List of options used for the auto complete.

Description:

With this function you can set some options for a specific textfield for auto completion.

Example

<?php 

// include the class 
include('FH3/class.FormHandler.php'); 

// create a new formhandler object 
$form = new FormHandler(); 

// the auto complete items 
$colors = array ( "red""orange""yellow""green""blue""indigo""violet""brown""rood" ); 
// the textfield used for auto completion 
$form -> textField("Type a color""color"FH_STRING); 

// set the auto completion for the field Color 
$form -> setAutoComplete("color"$colors); 

// button to submit the form 
$form -> submitButton(); 

// set the handler 
$form -> onCorrect('doRun'); 

// display the form 
$form -> flush(); 

// the data handler 
function doRun$data 

    echo 
"<pre>"
    
print_r$data ); 
    echo 
"</pre>"

?>

Preview image

preview image

See also: TextField

Latest change: 05 March 10 / 08:45

Comments

powered by PHP-GLOBE   © 2004 - 2024 FormHandler. All rights reserved.   -   Open source license