<error>
Catches an error event.
Syntax
<error
count="integer"
cond="js_expression"
>
Executable Content
</error>
Description
Shorthand for <catch event="error">. Catches error events of all kinds.
| Attribute |
Description |
count
|
Minimum number of times an error must have occurred during a form or menu invocation. Optional (default is 1).
|
cond
|
JavaScript expression that must also evaluate to true for an event to be caught. Optional (default is true).
|
If multiple error handlers are defined in, or inherited by, the element in which the error occurs, one handler is chosen based on event count, scope, and document order. See Chapter 3, Event Handling.
|
|
Tips:
|
| | Within an event handler, the _event variable contains the name of the event currently being handled; the _message variable contains the message string that provides additional information about the event. If no message was supplied when the event was thrown, the _message variable is undefined. |
|
| | If a JavaScript expression contains any of the characters "<", ">", or "&", that character must be replaced with the corresponding escape sequence "<", ">", or "&". For more information, see JavaScript Quick Reference. |
|
Usage
See Also
Examples
<?xml version="1.0" ?>
<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN"
"http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form id="foo">
<error>
<prompt> That code is bad! <value expr="code"/></prompt>
<disconnect/>
</error>
<field name="code" type="digits">
<prompt> Say your passcode now. </prompt>
<filled>
<if cond="code < 100">
<throw event="error"/>
<else/>
<prompt>Good passcode!</prompt>
</if>
</filled>
</field>
<block>
<prompt>That was the last form item.</prompt>
<disconnect/>
</block>
</form>
</vxml>
[Show Frames] [FIRST] [PREVIOUS] [NEXT]