<option>
An option list is represented by a set of <option> elements
contained in a <field> element. Each <option> element
contains PCDATA that is used to generate a speech grammar.
Attributes
| dtmf |
The DTMF sequence for
this option. It is equivalent to a simple DTMF <grammar>, and
DTMF properties apply to recognition of the sequence. |
| value |
The string to assign to
the field's form item variable when a user selects this option, whether
by speech or DTMF. The default assignment is the CDATA content of the
<option> element, with leading and trailing white space removed.
If this does not exist, then the DTMF sequence is used instead. |
| accept |
(defaults to "exact")
When set to "exact", the text of the option element defines the exact
phrase to be recognized. When set to "approximate", the text of the
option element defines an approximate recognition phrase. |
Child Tags
none
Parent Tags
<field>
Notes
none
Example
<?xml version="1.0"?> <vxml version="2.0"> <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> <!-- Notice that, while this third option specifies --> <!-- "frog legs" as the option text, if the caller --> <!-- chooses this option, the "maincourse" field will be --> <!-- set to the value "chicken". --> <option dtmf="3" value="chicken"> frog legs </option> <filled> You chose <value expr="maincourse"/>. </filled> </field> </form> </vxml>
|
An interaction with the above script could be:
Computer:
Please select an
entree.
Computer: Today, we're
featuring: swordfish, roast beef, frog legs.
Human: Frog
legs.
Computer: You chose
chicken.
|