<option>

Generates a grammar for a simple response to field options.

Syntax

<option
    accept = "{exact | approximate}"
    dtmf = "CDATA"
    value = "CDATA"
/>

Attributes

Attribute

Data Type

Required?

Default

Description

accept

{approximate | exact}

no

exact

Determines how the option is activated. Valid values:

  • approximate = Utterance must match a sub-phrase to activate this option.

  • exact = Utterance must match the entire choice phrase to activate this option.

dtmf

CDATA

no

NA

DTMF sequence for this option.

value

CDATA

no

NA

String to assign to the field item variable when a user selects this option by speech or DTMF.

Details

If the dtmf attribute is unspecified, the option cannot be matched using DTMF.

If the value attribute is unspecified, the VoiceXML Interpreter assigns default data to the option as follows:

Parents

<field>

Children

None.

Example

<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
    <meta name="author" content=""/>
    <meta name="maintainer" content=""/>
    <form id="options">
        <catch event="nomatch noinput">
            <prompt> Please select an option. </prompt>
            <reprompt/>
        </catch>
        <field name="myOption">
            <prompt>
                Please select from the following list: <enumerate/>
            </prompt>
            <option value="inquiry"> billing inquiry </option>
            <option value="statement"> last statement </option>
            <option value="balance"> current balance </option>
            <option value="support"> customer support </option>

            <filled>
                <prompt>You chose <value expr="myOption"/> </prompt>
            </filled>
        </field>
    </form>
</vxml>

See Also

<choice>, <field>