<form>

Dialog that defines an interaction for collecting values for a set of field item variables.

Syntax

<form 
    id = "identifier"
    scope = "dialog|document"
/> 

Attributes

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:

  • dialog = Grammar is only active in the current form.

  • document = Grammar is active throughout the current document.

Details

A form can contain the following items:

Parents

<vxml>

Children

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

Example

<?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>

See Also

<menu>