# \<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>](/dev/voicexml/tags/audio-tag.md), [\<catch>](/dev/voicexml/tags/catch-tag.md), [\<choice>](/dev/voicexml/tags/choice-tag.md), [\<enumerate>](/dev/voicexml/tags/enumerate-tag.md), [\<error>](/dev/voicexml/tags/error-tag.md), [\<help>](/dev/voicexml/tags/help-tag.md), [\<noinput>](/dev/voicexml/tags/noinput-tag.md), [\<nomatch>](/dev/voicexml/tags/nomatch-tag.md), [\<prompt>](/dev/voicexml/tags/prompt-tag.md), [\<property>](/dev/voicexml/tags/property-tag.md), [\<value>](/dev/voicexml/tags/value-tag.md)

### Parent Tags

[\<vxml>](/dev/voicexml/tags/vxml-tag.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plumvoice.com/dev/voicexml/tags/menu-tag.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
