skipv1_0_0autocomplete
skip_autocomplete( $name, $elements, $args );.
Description
skip\v1_0_0\autocomplete( (string) $name, (array/string) $elements, (constant) $label = FALSE, (array) $args = array() );
Adding a jQuery UI autocomplete
field.
Default UsageThis will create an automated saved field with Autocomplete
values Berlin, London, New York, Paris and Tokyo.
Parameters
$name
// (string) (required) The name of the field.
$element
s
// (array/comma separated string) (required) The element
s for the autocompleting values.
$args
// (array/string) (optional) Values for further settings.
$args
Settings
- id (string) ID if the HTML
Element
. - label (string) Label for
Element
. - default (string) Default Value if no Value is set before.
- classes (string) Name of CSS Classes which will be inserted into HTML seperated by empty space.
- before_
element
(string) Content before theelement
. - after_
element
(string) Content after theelement
.
Example
Creating a labeled Textfield with a set cities as autocomplete
Values in an automatic saved form.
skip_form_start( myformname );
$cities
= array( Berlin,, London, New York, Paris, Tokyo );
$args
= array(
'id' = myelement
id,
'label' => City
);
skip_autocomplete
( city, $cities
, $args
);
skip_form_end(…);
Getting back the saved data.
$city
= skip_value( myformname , city );
Parameters (4)
- 0. $name (string)
- Name of
Autocomplete
field. - 1. $elements (array/string)
- List of Elements.
- 2. $label — Optional. (constant) =>
FALSE
- List of Arguments.
- 3. $args — Optional. (array) =>
array()
- The args.
Usage
if ( !function_exists( 'skip\v1_0_0\autocomplete' ) ) { require_once ABSPATH . PLUGINDIR . 'facebook-fanpage-import/includes/skip/elements/forms/autocomplete.php'; } // Name of Autocomplete field. $name = ''; // List of Elements. $elements = null; // List of Arguments. $label = FALSE; // The args. $args = array(); // NOTICE! Understand what this does before running. $result = skip\v1_0_0\autocomplete($name, $elements, $label, $args);
Defined (1)
The function is defined in the following location(s).