Class icms_ipf_form_elements_Autocomplete
To make the Autocomplete field work, the include file needs to look like the following (in this example the Autocomplete field would use the conf_name field of the config table as a lookup):
include "mainfile.php"; icms::$logger->disableLogger(); $sql = "SELECT * FROM " . icms::$xoopsDB->prefix("config") . " WHERE conf_name LIKE '%" . $_GET['term'] . "%'"; $result = icms::$xoopsDB->query($sql); while ($myrow = icms::$xoopsDB->fetchArray($result)) $ret[] = array("item" => $myrow["conf_name"]); echo $_GET["callback"] . "(" . json_encode($ret) . ")";
Important: - use control parameter "file" to specify the include file for the autocomplete - the include file must be specified without ICMS_URL or ICMS_ROOT_PATH - if the include file does not exist, the form field is displayed as a text field - use control parameter "minlength" to specify the minimum amount of characters before the autocomplete function starts to work (default: 3) - use control parameter "delay" to specify the delay before the autocomplete function starts to work. Use with caution since it can result in high server load! (default: 500)
- icms_form_Element
- icms_form_elements_Text
- icms_ipf_form_elements_Autocomplete
Copyright: The ImpressCMS Project http://www.impresscms.org/
License: GNU General Public License (GPL)
Author: marcan marcan@impresscms.org
Located at ipf/form/elements/Autocomplete.php
public
|
|
public
string
|
getMaxlength(),
getSize(),
getValue(),
setValue()
|
$autocomplete
|
$_caption,
$_name,
$customValidationCode
|