|
Newsletters
|
|
|
|
|
Voice XML Reference
Voice XML Reference
Bookmark this page
The form Element - <form>
Description: Forms are the key component 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 field items, those that define the form's field item variables, and control items, those that help control the gathering of the form's fields.
- Declarations of non-field item variables.
- Event handlers.
- "Filled" actions, blocks of procedural logic that execute when certain combinations of field items are filled in.
Example:
<form id="weather_info">
<block>Welcome to the weather information service.</block>
<field name="state">
<prompt>What state?</prompt>
<grammar src="state.gram" type="application/x-jsgf"/>
<catch event="help">
Please speak the state for which you want the weather.
</catch>
</field>
<field name="city">
<prompt>What city?</prompt>
<grammar src="city.gram" type="application/x-jsgf"/>
<catch event="help">
Please speak the city for which you want the weather.
</catch>
</field>
<block>
<submit next="/servlet/weather" amelist="city state"/>
</block>
</form>
| Attributes |
| Name |
Value |
Description |
| id |
PCDATA |
The name of the form. |
| scope |
"dialog", "document" |
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 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. A form grammar that has dialog scope is active only in its form. |
Back to Tag Listing
|
|