Last Updated: 08-30-2005
Specifies an action to perform when the VoiceXML interpreter
assigns a value to the named variable of a
mode = "all_any"
namelist = "space_delimited_list"
- Determines when a form-level filled element executes.
||Indicates that the contents of the filled element will be executed only when all of the input items specified in the namelist are filled.
||Indicates that the contents of the filled element will be executed when any of the input items specified in the namelist are filled.
- The input items to trigger on. For a filled element in a form, namelist defaults
to the names of all the form's input items.
A filled element in an input item
cannot specify a namelist; the namelist in this case is the
input item name.
|The filled element contains executable content that is executed when a user's
utterance matches an active grammar. As a child of a form element, the filled
element executes content when a combination of one or more input items is filled. As a child of an input item, such as a
field, it specifies an action to perform after that input item is filled.|
|The mode and namelist attributes
are only appropriate for a filled element in a form.
If a mode or namelist attribute is specified
for a filled element
in an input item, then the attribute is ignored prior to revision 3, but in
revision 3 and later,
the interpreter throws error.badfetch.
|If any input items specified by the namelist do not exist, then
prior to revision 3, the interpreter ignores them. In
revision 3 and later, the interpreter throws
error.semantic in that situation.|
The following examples demonstrates a simple use of the filled element. If a 10-digit
phone number is matched, execution proceeds to the CallNumber dialog which dials the number
using the transfer element. If any other value is
input, it will be rejected as an invalid phone number.
The following example demonstrates how to take different actions based on the recognized
result. The code within the filled element checks the value of test_number.
If the number is between one and three, the result is accepted and the user is navigated to the Tellme menu.
Otherwise, the user is asked to try again.
A sample transcript for this example follows:
||Pick a number between one and three
||Four is not between one and three. Pick a number between one and three.
||You said three
<rule id="root_rule" scope="public">
<!-- user may say a valid number or Tellme menu -->
<grammar src="builtin:digits" />
<prompt> Pick a number between one and three </prompt>
<catch event="nomatch noinput">
<prompt>Sorry. I didn't get that.</prompt>
<!-- take action dependent upon value -->
<!-- if it is a valid number ... -->
<if cond=" parseInt(test_number, 10) >= 1 &&
parseInt(test_number, 10) <= 3 ">
<prompt> You said <value expr="parseInt(test_number, 10)" /> </prompt>
<!-- implicitly exit interpreter -->
<!-- otherwise, it must not be valid -->
<prompt> <value expr="test_number"/> is not between one and three </prompt>