|
Newsletters
|
|
|
|
|
Voice XML Reference
Voice XML Reference
Bookmark this page
The option Element - <option>
Description: When a simple set of alternatives is all that is needed to specify the legal input values for a field,
it may be more convenient to use an option list than a grammar. 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 grammar for the spoken input it accepts using the
same method described for <choice>. It also has attributes specifying the DTMF key for
selecting the option and the value to assign to the field when the option is chosen.
Example:
<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="chicken"> frog legs </option>
<filled>
<submit next="/cgi-bin/maincourse.cgi" method="post" namelist="maincourse"/>
</filled>
</field>
</form>
| Attributes |
| Name |
Value |
Description |
| dtmf |
PCDATA |
The DTMF sequence for this choice. |
| value |
PCDATA |
The string to assign to the field item variable when a user selects this
option, whether by speech or DTMF. The default value for this
attribute is the CDATA content of the <option> element with
leading and trailing white space removed. |
Back to Tag Listing
|
|