<option>

Specifies an option within an input field. An option list is represented by a set of <option> elements within a <field> element. Note that the <option> element does not only contain PCDATA. 

With Voice Platform, you can also specify <grammar> elements and embedded text-to-speech elements within your option list. This means you can specify <grammar> elements to override any grammar automatically generated by the option list.

Attributes

This section describes the attributes you can set for this element.

Name

Data type

Default

accept

(exact | approximate)

exact

dtmf

CDATA

optional

value

CDATA

optional

accept

The accept attribute specifies the default grammar for each <option> element. If you set this attribute to exact (default), the text that appears within the <option> element specifies the exact phrase to be recognized. If you set this attribute to approximate, then the text that appears within the <option> element specifies an approximate recognition phrase. For example, in response to the prompt "American Heart Association," subphrases such as "Heart Association" or "American Heart" would be recognized.

dtmf

The dtmf attribute specifies the DTMF sequence that is assigned to a choice. The DTMF sequence can be one or more of:

  • 1-9
  • *
  • #

value

The value attribute specifies the string that is assigned to the field item variable when an option is selected.

Children

Parents

Sample code

<form>
    <field name="maincourse">
        <prompt> Please select an entree. Today, we're featuring
            <enumerate/>
        </prompt>
            <option value="fish"> swordfish </option>
            <option value="beef"> roast beef </option>
            <option value="chicken"> frog legs </option>
        <filled>
            Thank you for your order of <value expr="maincourse"/>
        </filled>
    </field>
</form>