|
|
 |
 |
 |
|
(Since version FH3 v1.2.2)
SetAutoCompleteAfter |
SetAutoCompleteAfter (
string |
$field |
string |
$after |
array |
$options |
) |
Arguments:
Name |
Description |
$field |
The textfield where you want to set some autocomplete options for. |
$after |
The chracter after which we will start completion. |
$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 after a specified character
Example
<?php
// include the class
include('FH3/class.FormHandler.php');
// create a new formhandler object
$form = new FormHandler();
// the auto complete items
$providers = array ( "hotmail.com", "live.com", "php-globe.nl", "freeler.nl" );
// the textfield used for auto completion after
$form -> textField("Type your email", "email", FH_STRING);
// set the auto completion for the field Color
$form -> setAutoCompleteAfter("email", "@", $providers);
// 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>";
}
?>
|
See also: TextField
Latest change: 05 March 10 / 08:45
Comments
|
|
|
|