Allows the user to specify a choice from a list of options.
<menu
accept = "{exact | approximate}"
dtmf = "{true | false}"
id = "identifier"
scope = "{document | dialog}"
/>
Attribute |
Data Type |
Required? |
Default |
Description |
accept |
{exact | approximate} |
no |
exact |
Determines how a choice phrase is activated. Valid values:
Each choice can override this setting. |
dtmf |
boolean |
no |
no |
Assigns implicit DTMF elements to the choices contained in the menu. Valid values:
|
id |
identifier |
no |
NA |
Unique name of the menu. This facilitates the transfer of control from dialog to dialog. |
scope |
{document | dialog} |
no |
dialog |
Scope for the grammar contained in the menu. Valid values:
|
<audio>, <catch>, <choice>, <enumerate>, <error>, <help>, <noinput>, <nomatch>, <prompt>, <property>, <script>, <value>
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<catch event="quitEvent">
Goodbye
<exit/>
</catch>
<!--
With dtmf="true", the DTMF sequence for each
choice will be assigned automatically: 1, 2 and 3
-->
<menu id="main" dtmf="true">
<prompt>What do you want to eat, apple or orange?</prompt>
<choice next="#formApple"> apple </choice>
<choice expr="'#' + 'formOrange'"> orange </choice>
<choice event="quitEvent"> quit </choice>
<nomatch>Please say one of <enumerate/></nomatch>
</menu>
<form id="formApple">
<block>
You chose apple
<exit/>
</block>
</form>
<form id="formOrange">
<block>
You chose orange
<exit/>
</block>
</form>
</vxml>