The <return> element ends execution of a subdialog and returns control and data to a calling dialog.
| namelist | Variable names to be returned to calling dialog. The default is to return no variables; this means the caller will receive an empty ECMAScript object. |
| event | Return, then throw this event. |
| eventexpr | This attribute is not supported. |
| message | This attribute is not supported. |
| messageexpr | This attribute is not supported. |
None
<?xml version="1.0"?>
<vxml version="2.0">
<!-- form dialog that calls a subdialog -->
<var name="myname" expr="'Jane Doe'"/>
<form>
<subdialog name="result" src="#getdriverslicense" namelist="myname">
<param name="birthday" expr="'February 10th, 1970'"/>
<filled>
<!-- Reference returned variables as ECMAscript -->
<!-- member variables of the field name "result". -->
You entered <value expr="result.drivelicense"/>.
<submit next="http://nonexistent.domain.com/process.pl"
method="post"
namelist="result.drivelicense birthday"/>
</filled>
</subdialog>
</form>
<!-- subdialog to get drivers license -->
<form id="getdriverslicense">
<var name="birthday"/>
<field name="drivelicense" type="digits">
<prompt>
<value expr="myname"/>,
your birthdate is: <value expr="birthday"/>.
Please say your driver's license number.
</prompt>
<filled>
<!-- All variables specified in the "return" tag's -->
<!-- "namelist" attribute will be returned to the -->
<!-- calling dialog. -->
<return namelist="drivelicense"/>
</filled>
</field>
</form>
</vxml>The output of the above script would be:
Computer: Jane Doe, your birthdate is: February 10th, 1970.
Computer: Please say your driver's license number.
Human: One two three four five six seven eight nine.
Computer: You entered one hundred twenty-three million, four hundred fifty-six thousand, seven hundred eighty-nine.
(continues on to processing form…)
None
<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>