ZVON > References > VoiceXML Reference
Element:return
Attributes: | event | namelist |
Parents: | block | catch | error | filled | help | if | noinput | nomatch |
Description:

Go to Standard

Examples:


<vxml version="1.0">
     <form id="basic">
          <field name="acctnum" type="digits">
               <prompt> What is your account number? </prompt>
          </field>
          <field name="acctphone" type="phone">
               <prompt> What is your home telephone number? </prompt>
               <filled>
                    <return namelist="acctnum acctphone"/>
               </filled>
          </field>
     </form>
</vxml>


<form id="getssn">
     <field name="ssn">
          <grammar src="http://grammarlib/ssn.gram" type="application/x-jsgf"/>
          <prompt> Please say social security number.</prompt>
          <nomatch count="3">
               <return event="nomatch"/>
          </nomatch>
          <filled>
               <return namelist="ssn"/>
          </filled>
     </field>
</form>


<form id="getssn">
     <field name="ssn">
          <grammar src="http://grammarlib/ssn.gram" type="application/x-jsgf"/>
          <prompt> Please say social security number.</prompt>
          <nomatch count="3">
               <return event="nomatch"/>
          </nomatch>
          <filled>
               <return namelist="ssn"/>
          </filled>
     </field>
</form>


<vxml version="1.0">
     <form id="getdriverlicense">
          <var name="birthday" expr="'1980-02-10'"/>
          <field name="drivelicense">
               <grammar src="http://grammarlib/drivegrammar.gram" type="application/x-jsgf"/>
               <prompt> Please say your driver’s license number. </prompt>
               <filled>
                    <if cond="validdrivelicense(drivelicense,birthday)">
                         <var name="status" expr="true"/>
                         <else/>
                         <var name="status" expr="false"/>
                    </if>
                    <return namelist="drivelicense status"/>
               </filled>
          </field>
     </form>
</vxml>


<form id="getssn">
     <var name="firstname"/>
     <var name="lastname"/>
     <field name="ssn">
          <grammar src="http://grammarlib/ssn.gram" type="application/x-jsgf"/>
          <prompt> Please say social security number. </prompt>
          <filled>
               <if cond="validssn(firstname,lastname,ssn)">
                    <assign name="status" expr="true"/>
                    <return namelist="status ssn"/>
                    <else/>
                    <assign name="status" expr="false"/>
                    <return namelist="status"/>
               </if>
          </filled>
     </field>
</form>


<form>
     <subdialog name="result" src="#getdriverslicense">
          <param name="birthday" expr="'2000-02-10'"/>
          <filled>
               <submit next="http://myservice.example/cgi-bin/process"/>
          </filled>
     </subdialog>
</form>
<form id="getdriverslicense">
     <var name="birthday"/>
     <field name="drivelicense">
          <grammar src="http://grammarlib/drivegrammar.gram" type="application/x-jsgf"/>
          <prompt> Please say your driver's license. </prompt>
          <filled>
               <if cond="validdrivelicense(drivelicense,birthday)">
                    <var name="status" expr="true"/>
                    <else/>
                    <var name="status" expr="false"/>
               </if>
               <return namelist="drivelicense status"/>
          </filled>
     </field>
</form>


<vxml version="1.0">
     <form id="getcredit">
          <var name="status" expr="'no_result'"/>
          <var name="username"/>
          <field name="creditcardnum">
               <prompt> What is your credit card number? </prompt>
               <help> I am trying to collect your credit card information.
                    <reprompt/>
               </help>
               <nomatch>
                    <return namelist="status"/>
               </nomatch>
               <grammar/>
          </field>
          <field name="expirydate" type="date">
               <prompt> What is the expiry date of this card? </prompt>
               <help> I am trying to collect the expiry date of the credit card number you provided.
                    <reprompt/>
               </help>
               <nomatch>
                    <return namelist="status"/>
               </nomatch>
          </field>
          <block>
               <assign name="status" expr="'result'"/>
               <return namelist="status creditcardnum expirydate"/>
          </block>
     </form>
</vxml>


<vxml version="1.0">
     <form id="getcredit">
          <var name="status" expr="'no_result'"/>
          <var name="username"/>
          <field name="creditcardnum">
               <prompt> What is your credit card number? </prompt>
               <help> I am trying to collect your credit card information.
                    <reprompt/>
               </help>
               <nomatch>
                    <return namelist="status"/>
               </nomatch>
               <grammar/>
          </field>
          <field name="expirydate" type="date">
               <prompt> What is the expiry date of this card? </prompt>
               <help> I am trying to collect the expiry date of the credit card number you provided.
                    <reprompt/>
               </help>
               <nomatch>
                    <return namelist="status"/>
               </nomatch>
          </field>
          <block>
               <assign name="status" expr="'result'"/>
               <return namelist="status creditcardnum expirydate"/>
          </block>
     </form>
</vxml>


<vxml version="1.0">
     <form id="getcredit">
          <var name="status" expr="'no_result'"/>
          <var name="username"/>
          <field name="creditcardnum">
               <prompt> What is your credit card number? </prompt>
               <help> I am trying to collect your credit card information.
                    <reprompt/>
               </help>
               <nomatch>
                    <return namelist="status"/>
               </nomatch>
               <grammar/>
          </field>
          <field name="expirydate" type="date">
               <prompt> What is the expiry date of this card? </prompt>
               <help> I am trying to collect the expiry date of the credit card number you provided.
                    <reprompt/>
               </help>
               <nomatch>
                    <return namelist="status"/>
               </nomatch>
          </field>
          <block>
               <assign name="status" expr="'result'"/>
               <return namelist="status creditcardnum expirydate"/>
          </block>
     </form>
</vxml>