# \<menu>

## \<menu> <a href="#menu" id="menu"></a>

A menu is a convenient syntactic shorthand for a form containing a single anonymous field that prompts the user to make a choice and transitions to different places based on that choice.

### Attributes

<table><thead><tr><th width="168.33333333333331">Name</th><th width="168">Data type<select><option value="605f88c365d3450baac9302bee15b458" label="String" color="blue"></option><option value="52004cf9678b4712ab1a6edc99bffa09" label="Integer" color="blue"></option><option value="27689e65917347a593f6fe7379b75659" label="Boolean" color="blue"></option></select></th><th>Description</th></tr></thead><tbody><tr><td>id</td><td><span data-option="605f88c365d3450baac9302bee15b458">String</span></td><td>The identifier of the menu. It allows the menu to be the target of a &#x3C;goto> or a &#x3C;submit>. This attribute does not allow for any white space.</td></tr><tr><td>scope</td><td><span data-option="605f88c365d3450baac9302bee15b458">String</span></td><td><p>(default is “dialog”) The menu's grammar scope. Accepted values include "dialog" and "document". </p><p></p><p>If set to "dialog", the menu's grammars are only active when the user transitions into the menu.</p><p></p><p>If set to "document", grammars are active over the whole document (or if the menu is in the application root document, any loaded document in the application).</p></td></tr><tr><td>accept</td><td><span data-option="605f88c365d3450baac9302bee15b458">String</span></td><td><p>(default is “exact”) Accepted values include "exact" and "approximate".</p><p></p><p>When set to “exact”, the text of the choice elements in the menu defines the exact phrase to be recognized.</p><p></p><p>When set to “approximate”, the text of the choice elements defines an approximate recognition phrase.</p><p></p><p>Each &#x3C;choice> can override this setting.</p></td></tr><tr><td>dtmf</td><td><span data-option="27689e65917347a593f6fe7379b75659">Boolean</span></td><td><p>When set to true, the first nine choices that have not explicitly specified a value for the dtmf attribute are given the implicit ones “1”, “2”, etc. </p><p></p><p>Remaining choices that have not explicitly specified a value for the dtmf attribute will not be assigned DTMF values (and thus cannot be matched via a DTMF keypress).</p></td></tr></tbody></table>

### Notes

The id attribute for this tag does not allow for any white space.

### Example

```markup
<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\"?>\n";
?>
<vxml version="2.0">
  <menu id="departments">
    <prompt>
      News Departments:
      Press 1 or say sports to be transfered to Sports.
      Press 2 or say weather to be transfered to Weather.
      Press 3 or say operator assistance to be transferred to Operator Assistance.
    </prompt>
    <choice dtmf="1" next="#sports">Sports</choice>
    <choice dtmf="2" next="#weather">Weather</choice>
    <choice dtmf="3" accept="approximate" next="#operator">Operator Assistance</choice>
    <noinput>Sorry, I didn't hear you.</noinput>
    <nomatch>Sorry, I didn't understand you.</nomatch>
  </menu>
  <form id="sports">
    <block>
      <prompt>
        The Rainbow Cubs hit a home run to win the game.
      </prompt>
    </block>
  </form>
  <form id="weather">
    <block>
      <prompt>
        It's raining cats and dogs.
      </prompt>
    </block>
  </form>
  <form id="operator">
    <block>
      <prompt>
        Sorry, there is no operator assistance available.
      </prompt>
    </block>
  </form>
</vxml>
```

The output of the above script would be:

> Computer: News Departments: Press 1 or say sports to be transfered to Sports. Press 2 or say weather to be transfered to Weather. Press 3 or say operator assistance to be transfered to Operator Assistance.\
> Human: Sports.\
> Computer: The Rainbow Cubs hit a home run to win the game.

### Child Tags

[\<audio>](https://docs.plumvoice.com/dev/voicexml/tags/audio-tag), [\<catch>](https://docs.plumvoice.com/dev/voicexml/tags/catch-tag), [\<choice>](https://docs.plumvoice.com/dev/voicexml/tags/choice-tag), [\<enumerate>](https://docs.plumvoice.com/dev/voicexml/tags/enumerate-tag), [\<error>](https://docs.plumvoice.com/dev/voicexml/tags/error-tag), [\<help>](https://docs.plumvoice.com/dev/voicexml/tags/help-tag), [\<noinput>](https://docs.plumvoice.com/dev/voicexml/tags/noinput-tag), [\<nomatch>](https://docs.plumvoice.com/dev/voicexml/tags/nomatch-tag), [\<prompt>](https://docs.plumvoice.com/dev/voicexml/tags/prompt-tag), [\<property>](https://docs.plumvoice.com/dev/voicexml/tags/property-tag), [\<value>](https://docs.plumvoice.com/dev/voicexml/tags/value-tag)

### Parent Tags

[\<vxml>](https://docs.plumvoice.com/dev/voicexml/tags/vxml-tag)
