|
Newsletters
|
|
|
|
|
Voice XML Reference
Voice XML Reference
Bookmark this page
The field Element - <field>
Description: A field specifies an input item to be gathered from the user.
Example:
<field name="lo_fat_meal" type="boolean">
<prompt>Do you want a low fat meal on this flight?</prompt>
<help>Low fat means less than 10 grams of fat, and under
250 calories.</help>
<filled>
<prompt> I heard <emp><value expr="lo_fat_meal"/></emp>.</prompt>
</filled>
</field>
| Attributes |
| Name |
Value |
Description |
| name |
PCDATA |
The field item variable in the dialog scope that will hold the result. |
| expr |
PCDATA |
The initial value of the form item variable; default is ECMAScript undefined. If initialized to a value, then the form item will not be visited unless the form item variable is cleared. |
| cond |
boolean |
A boolean condition that must also evaluate to true in order for the form item to be visited. |
| type |
PCDATA |
The type of field, i.e., the name of an internal grammar. This name must be from a standard set supported by all conformant platforms. If not present, <grammar> and/or <dtmf> elements can be specified instead. |
| slot |
PCDATA |
The name of the grammar slot used to populate the variable (if it is absent, it defaults to the variable name). This attribute is useful in the case where the grammar format being used has a mechanism for returning sets of slot/value pairs and the slot names differ from the field item variable names. If the grammar returns only one slot, as do the built-in type grammars like boolean, then no matter what the slot's name, the field item variable gets the value of that slot. |
| modal |
boolean |
If this is false (default), all active grammars are turned on while collecting this field. If this is true, then only the field's grammars are enabled; all others are temporarily disabled. |
Back to Tag Listing
|
|