Table of Contents

< option >

Description

The <option> element 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>.

Syntax

<option
dtmf="DTMF sequence"
value="String">
text
</option>

Attributes

dtmfThe dtmf attribute is the DTMF sequence for this option. This attribute is optional, yet is required if the menu has the dtmf attribute that is true.
valueThe value attribute is the string to assign to the field item variable. This option is selected, whether by speech or DTMF. This attribute is optional and defaults to the dtmf attribute if specified. Otherwise, it defaults to the option text with leading and trailing white space removed.

Parents

<field>

Children

None.

Extensions

None.

Limitations/Restrictions

The attribute dtmf is required, if the menu has the dtmf attribute that is true.

Example Code

<?xml version="1.0"?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
 <form>
  <field name="maincourse">
   <prompt>
     Please select an entree. Today, we're featuring:
    <enumerate/>
   </prompt>
   <option dtmf="1" value="fish"> swordfish </option>
   <option dtmf="2" value="beef"> roast beef </option>
   <option dtmf="3" value="frog"> frog legs </option>
   <filled>
    <prompt>
     <value expr="maincourse"/>, good choice.
     Please enjoy your meal.
    </prompt>
    <submit next="maincourse.cgi"
     method="post" namelist="maincourse"/>
   </filled>
  </field>
 </form>
</vxml>