Contains a series of field items to be filled through interaction with the user.
id = "string"
scope = "document_dialog"/>
- DEPRECATED. Controls whether the dialog is added to a history list. Please read the Implementing 'Go Back' tutorial to learn how to implement your own history list.
- Required. The name of the form, unique to the document in which it is contained. Use the id as an anchor to jump to with a goto directive.
- The default scope of the form element's grammars.
|block, catch, data, error, field, filled, grammar, help, initial, link, noinput, nomatch, object, property, record, script, subdialog, transfer, var|
|The form element contains the core logic of your voice application, including grammars, prompts, and code to execute based on the user's response. When the Tellme Platform loads a VoiceXML document, it executes the first form element in document source order. Subsequent dialogs in the document must be navigated to explicitly using the goto element or the subdialog element if the target dialog is a subdialog.|
|The scope of individual grammar elements takes precedence over the form's scope. For example, if the form's scope is set to dialog, but the scope of the grammar within the form is set to document, the grammar is active within any dialog in the document.|
|If a filled element inside a form element occurs before a filled element inside a field, then the form's filled element takes precedence.|
This example shows the most basic use of the form element; it simply says "Hello, world" and exits.
<?xml version="1.0"?> <vxml version="2.1" xmlns="http://www.w3.org/2001/vxml"> <!-- The classic "Hello, world" application --> <form> <block> Hello, world <!-- automatically returns to the Tellme menu --> </block> </form> </vxml>
<?xml version="1.0"?> <vxml version="2.1" xmlns="http://www.w3.org/2001/vxml"> <!-- Greet the world --> <form id="hello"> <block> Hello world <!-- navigate to the next form --> <!-- without a goto, interpreter exits --> <goto next="#welcome" /> </block> </form> <!-- Welcome the user to 555-TELL --> <form id="welcome"> <block> Welcome to Tell me <exit /> </block> </form> </vxml>