Last reviewed: 3/23/2024 12:36:12 PM

<return>

A <return> element returns from a subdialog.

Syntax

<return event="event"
        eventexpr="expression"
        message="string"
        messageexpr="expression"
        namelist="var1 ..." />

Attributes

event

Return, then throw this event.

eventexpr

Return, then throw the event to which this ECMAScript expression evaluates.

message

A message string providing additional context about the event being thrown. The message is available as the value of a variable within the scope of the catch element.

messageexpr

An ECMAScript expression evaluating to the message string.

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. If an undeclared variable is referenced in the namelist, then an error.semantic is thrown.

Children

none

Parents

<block>, <catch>, <error>, <filled>, <help>, <if>, <noinput>, <nomatch>, and <prompt>.

Variables

none

Example

The following example illustrates recording audio.

<form> 
  <subdialog name="result" src="#getssn"> 
    <nomatch> 
      <!-- a no match event that is returned by the
          subdialog indicates that a valid Social Securityy
          number could not be matched. --> 
      <goto next="http://myservice.example.com/ssn-problems.vxml"/> 
    </nomatch> 

    <filled> 
      <submit namelist="result.ssn" 
       next="http://myservice.example.com/cgi-bin/process"/> 
    </filled> 
  </subdialog> 
</form>
<form id="getssn"> 
  <field name="ssn"> 
      <grammar src="http://grammarlib/ssn.grxml" 
        type="application/srgs+xml"/>
      <prompt> Please say Social Securityy number.</prompt> 
      <nomatch count="3">
        <return event="nomatch"/> 
      </nomatch> 
      <filled> 
        <return namelist="ssn"/> 
      </filled> 
  </field> 
</form>

Version Information

Supported in: VoiceXML 1.0, VoiceXML 2.0, and VoiceXML 2.1.