Dialog that defines an interaction for collecting values for a set of field item variables.
<form
id = "identifier"
scope = "dialog|document"
/>
Attribute |
Data Type |
Required? |
Default |
Description |
id |
identifier |
no |
NA |
Unique name of the form. Having a unique name facilitates the transfer of control from form to form. |
scope |
{document|dialog} |
no |
dialog |
Scope for the grammar contained in the form. Valid values:
|
A form can contain the following items:
Input items filled by user utterances.
Control items that control form execution.
Event handlers.
Dialog-scoped variables.
Filled items, which specify the action to take after a field is input.
Properties.
<block>, <catch>, <data>, <error>, <field>, <filled>, <grammar>, <help>, <initial>, <link>, <noinput>, <nomatch>, <object>, <property>, <record>, <script>, <subdialog>, <transfer>, <var>
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form id="creditCard">
<field name="cardtype">
<prompt>Which credit card type ?</prompt>
<grammar type="application/srgs+xml" root="cardtype">
<rule id="cardtype">
<one-of>
<item>american express <tag>amex</tag></item>
<item>master card <tag>mc</tag></item>
<item>visa <tag>visa</tag></item>
</one-of>
</rule>
</grammar>
<noinput count="1">
Sorry I didn't hear you
<reprompt/>
</noinput>
<noinput count="2">
Sorry still didn't hear you
<reprompt/>
</noinput>
<nomatch count="1">
<prompt>
Sorry I didn't understand please repeat the card type
</prompt>
</nomatch>
<nomatch count="2">
<prompt>
I still don't understand please select either american
express or master card or visa
</prompt>
</nomatch>
<filled>
<prompt>
You selected <value expr="cardtype"/>
</prompt>
</filled>
</field>
</form>
</vxml>