# <option>

Description

Specifies an option in a `<field>`. It is a convenient way to specify a list of choices in a field without specifying a grammar. The grammar is generated automatically from the text contained in each `<option>` and the optionally specified dtmf sequence in each `<option>`.

Syntax

    <option
        dtmf="DTMF_sequence"
        accept="exact" | "approximate"
        value="string">
      text
    </option>

Attributes

Attribute | Description
dtmf | A DTMF sequence to select this option. Optional.
accept | Specifies how to generate the grammar for this `<option>` element. Optional. (Defaults to exact.) exact - The text contained in the `<option>` element defines the exact phrase to be recognized. approximate - The text contained in the `<option>` element defines an approximate recognition phrase. A subset of the words in the phrase can be matched. For example, "hello world" can be matched with "hello world", "hello", or "world".
value | The string to assign to the field variable when this option is selected, either by speech or DTMF. Optional. (Defaults to the option text with leading and trailing white space removed, if specified. Otherwise, defaults to the value of the dtmf attribute.)

Parents

<field>

Children

#PCDATA

Extensions

None.

Limitations/Restrictions

- When using OSR, an option like `<option>` yellow - color `</option>` (where '-' is specified in the grammar utterance) will cause a speech grammar error. This is a known issue with OSR.

Example

    <?xml version="1.0"?>
    <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
      <form>
        <field name="maincourse">
          <prompt>
            Please select either sword fish or roast beef.
          </prompt>
          <option dtmf="1"> sword fish </option>
          <option dtmf="2"> roast beef </option>
          <filled>
            Very good.
            I'll bring out your <value expr="maincourse"/>.
          </filled>
        </field>
      </form>
    </vxml>