SearchBox.onquerysubmitted event

[SearchBox is no longer available for use as of Windows 10. Instead, use AutoSuggestBox. ]

Raised awhen the user clicks the search glyph or presses Enter.

Syntax

<div 
    data-win-control="WinJS.UI.SearchBox" 
    data-win-options="{onquerysubmitted : handler}">
</div>
function handler(eventInfo) { /* Your code */ }
 
// addEventListener syntax
searchBox.addEventListener("querysubmitted", handler);
searchBox.removeEventListener("querysubmitted", handler);

Event information

Synchronous No
Bubbles Yes
Cancelable Yes

 

Event handler parameters

  • eventInfo
    Type: CustomEvent**

    An object that contains information about the event. The detail property of this object contains the following sub-properties:

    • detail.language
      The current locale.

    • detail.queryText
      The new query text.

    • detail.linguisticDetails
      A SearchQueryLinguisticDetails object that provides linguistic info about the query text.

    • detail.keyModifiers
      The virtual key used when submitting the query text. This property is set to a flags enum that has one or more of these possible values:

Virtual key modifier Description

none

Value: 0

No virtual key modifier.

control

Value: 1

The Ctrl (control) virtual key.

menu

Value: 2

The Menu virtual key.

shift

Value: 4

The Shift virtual key.

windows

Value: 8

The Windows virtual key.

 

Requirements

Minimum WinJS version

WinJS 3.0

Namespace

WinJS.UI

See also

SearchBox