UserGuide

Web Search Field

From Xojo Documentation

A Search Field is used for entering values that relate to searching. It operates similarly to a Text Field, but has a different look and extra features such a list of recently entered values and cue text.

A Search Field does not do any searching; it is used to get the text for searching.

WebKit-based browsers such as Safari or Chrome may show a Recent Searches menu within this control. The searches on the Recent Searches menu are stored in a cookie and are specific to the name of the WebSearchField. For example, if you have two Web Search Fields with the name "SearchField1" in the same app, the user will see the same Recent Searches menu for both. However, if the two Web Search Fields have different names or are in different apps, the Recent Searches menu will not contain the same data.

Use the Set Default Value feature to specify the default text.

The commonly used events and properties are listed below. Refer to WebSearchField in the Language Reference for the complete list.

Events

KeyPressed

Called when a key has been pressed while the field has focus. The Details parameters tells you which key was pressed. Remember that events such as this call back to the server to process the code. Due to latency between the browser and the server you do not want to have time consuming code in this event handler.

TextChanged

Called when the text has been changed, but only after the user has pressed return, enter or the field has lost focus.

Properties

CueText

Gets or sets the cue text (prompt text) that is displayed within the Text Field.

Text

Contains the text displayed in the text field.

Usage

A Search Field displayed in a Web Toolbar

To get the text the user typed in the Search Field, use the Text property:

Dim search As String
search = CustomerSearch.Text

See Also

WebSearchField class; UserGuide:Web UI topic