Specifies an input field for a form.
<field
cond = "CDATA"
expr = "CDATA"
modal = "{true|false}"
name = "identifier"
slot = "identifier"
type = "{ boolean | currency |date |digits | number | phone | time}"
/>
Attribute |
Data Type |
Required? |
Default |
Description |
cond |
CDATA |
no |
NA |
Boolean expression that must evaluate to ECMAScript true for the <field> element to execute. |
expr |
CDATA |
no |
ECMAScript undefined |
Initial value of the form item variable. |
modal |
boolean |
no |
NA |
Grammars to enable. Valid values:
|
name |
identifier |
no |
NA |
Name of a shadow variable or a field item variable that holds the recognition result. Shadow variables are values available from a field item, specified as fieldItemVariableName$.shadowVariable. Supported shadow variables are:
|
slot |
identifier |
no |
NA |
Name of the grammar slot used to populate the variable. If not specified, the value is the field item variable name. |
type |
{boolean | |
no |
NA |
Name of an internal grammar. Input can be through voice or DTMF. Valid values are:
|
<audio>, <catch>, <enumerate>, <error>, <filled>, <grammar>, <help>, <link>, <noinput>, <nomatch>, <option>, <prompt>, <property>, <value>
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<form>
<field name="sevendigits" type="digits?length=7" modal="true">
<prompt>Say or type a seven digit number</prompt>
</field>
<field name="answer" type="boolean" modal="true">
<prompt>Answer yes or no</prompt>
</field>
<filled namelist="sevendigits answer">
<prompt>
Your number was
<say-as interpret-as="vxml:digits">
<value expr="sevendigits"/>
</say-as>
<break time="80ms"/>
and you answered <value expr="answer"/>
<break time="80ms"/> Bye
</prompt>
</filled>
</form>
</vxml>