<form>

Forms are the key components of VoiceXML documents. A form contains:

Attributes

id The name of the form. If specified, the form can be referenced within the document or from another document. For instance <form id="weather">, <goto next="#weather">. Please note that this attribute does not allow for any white space.
scope The default scope of the form's grammars. If it is dialog, then the form grammars are active only in the form. If the scope is document, then the form grammars are active during any dialog in the same document. If the scope is document and the document is an application root document, then the form grammars are active during any dialog in any document of this application. Note that the scope of individual form grammars takes precedence over the default scope; for example, in non-root documents, given a form with the default scope "dialog" and a form grammar with the scope "document", that grammar is active in any dialog in the document.

Notes

Please keep in mind that the id attribute for this tag does not allow for any white space.


Example

<?xml version="1.0"?>
<vxml version="2.0">
  <form id="firstform">
    <block>
      <prompt>
        Jumping to the third form.
      </prompt>
      <!-- A "#" symbol followed by an identifier specifies a -->
      <!-- form or menu ID to jump to. -->
      <goto next="#thirdform"/>
    </block>
  </form>
  <form id="secondform">
    <block>
      <prompt>
        Disconnecting.
      </prompt>
      <disconnect/>
    </block>
  </form>
  <form id="thirdform">
    <block>
      <prompt>
        Jumping to the second form.
      </prompt>
      <goto next="#secondform"/>
    </block>
  </form>
</vxml>

The output of the above script would be:

Computer: Jumping to the third form.
Computer: Jumping to the second form.
Computer: Disconnecting.



Child Tags

<block>, <catch>, <data>, <error>, <field>, <filled>, <grammar>, <help>, <initial>, <link>, <noinput>, <nomatch>, <property>, <record>, <script>, <subdialog>, <transfer>, <var>



Parent Tags

<vxml>