Attention

TYPO3 v10 has reached end-of-life as of April 30th 2023 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.

Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.

widget.autocomplete

Simple autocomplete widget.

Note

Make sure to include jQuery and jQuery UI in the HTML, like that:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.3/themes/base/jquery-ui.css" type="text/css" media="all" />
<link rel="stylesheet" href="http://static.jquery.com/ui/css/demo-docs-theme/ui.theme.css" type="text/css" media="all" />

You can include the provided TypoScript template that includes the above snippet to the pages headerData.

Examples

Render lib object:

<input type="text" id="name" />
<f:widget.autocomplete for="name" objects="{posts}" searchProperty="author" storeSession="false">

Output:

<input type="text" id="name" />

The input field and the required JavaScript for the Ajax communication. The storeSession attribute can be used in any widget and will prevent cookie creation / session storage for the widget. See Resources/Private/Templates/ViewHelpers/Widget/Autocomplete/Index.html

Arguments

customWidgetId

DataType

string

Required

false

Description

Extend the widget identifier with a custom widget id

storeSession

DataType

mixed

Default

true

Required

false

Description

Store the widgets session (utilizing a cookie).

objects

DataType

mixed

Required

true

Description

Objects to auto-complete

for

DataType

string

Required

true

Description

Property to fill

searchProperty

DataType

string

Required

true

Description

Property to search within when filtering list