<form>
<form>
Forms are the key components of VoiceXML documents. A form contains:
A set of form items, elements that are visited in the main loop of the form interpretation algorithm. Form items are subdivided into input items that can be “filled” by user input and control items that cannot.
Declarations of non-form item variables.
Event handlers.
“Filled” actions, blocks of procedural logic that execute when certain combinations of input item variables are assigned.
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”>.
Note: This attribute does not allow any white space.
scope
The default scope of the form's grammars. Accepted values include "dialog" and "document".
If set to "dialog", then the form grammars are active only in the form. If set to "document", then the form grammars are active during any dialog in the same document.
If scope is set to "document", and the document is an application root document, then the form grammars are active during any dialog in any document of this application.
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
The id attribute for this tag does not allow any white space.
Example
The output of the above script would be:
Computer: Welcome! Let's move to a form where we gather some input. Computer: Enter your lucky number. User: <user enters: 3> Computer: Your lucky number is 3. Let's move on to another form. Computer: You've made it to the final form! Goodbye.
Child Tags
<block>, <catch>, <data>, <error>, <field>, <filled>, <grammar>, <help>, <initial>, <link>, <noinput>, <nomatch>, <property>, <record>, <script>, <subdialog>, <transfer>, <var>
Parent Tags
Last updated