ZVON > References > VoiceXML Reference
Element:reprompt
Parents: | block | catch | error | filled | help | if | noinput | nomatch |
Description:

Go to Standard

Examples:


<field name="want_ice_cream" type="boolean">
     <prompt>Do you want ice cream for dessert?</prompt>
     <prompt count="2"> If you want ice cream, say yes. If you don’t want ice cream, say no. </prompt>
     <noinput> I could not hear you.
          <reprompt/>
     </noinput>
</field>


<form id="get_from_and_to_cities">
     <grammar src="http://www.directions.example/grammars/from_to.gram"/>
     <block> Welcome to the Driving Directions By Phone. </block>
     <initial name="bypass_init">
          <prompt> Where do you want to drive from and to? </prompt>
          <nomatch count="1"> Please say something like "from Atlanta Georgia to Toledo Ohio". </nomatch>
          <nomatch count="2"> I’m sorry, I still don’t understand. I’ll ask you for information one piece at a time.
               <assign name="bypass_init" expr="true"/>
               <reprompt/>
          </nomatch>
     </initial>
     <field name="from_city">
          <grammar src="http://www.directions.example/grammars/city.gram"/>
          <prompt>From which city are you leaving?</prompt> … etc. …
     </field> … etc. …
</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>


<form id="weather_info">
     <grammar src="cityandstate.gram" type="application/x-jsgf"/>
     <block>
          <prompt bargein="false"> Welcome to the weather information service.
               <audio src="http://www.online-ads.example/wis.wav"/>
          </prompt>
     </block>
     <initial name="start">
          <prompt> For what city and state would you like the weather? </prompt>
          <help> Please say the name of the city and state for which you you would like a weather report.</help>
          <noinput count="1">
               <reprompt/>
          </noinput>
          <noinput count="2">
               <reprompt/>
               <assign name="start" expr="true"/>
          </noinput>
     </initial>
     <field name="state">
          <prompt>What state?</prompt>
          <help>Please speak the state for which you want the weather.</help>
     </field>
     <field name="city">
          <prompt>Please say the city in
               <value expr="state"/> for which you want the weather.
          </prompt>
          <help>Please speak the city for which you want the weather.</help>
          <filled>
               <if cond="city == 'Los Angeles' && state == undefined">
                    <assign name="state" expr="'California'"/>
               </if>
          </filled>
     </field>
     <field name="go_ahead" type="boolean" modal="true">
          <prompt>Do you want to hear the weather for
               <value expr="city"/>,
               <value expr="state"/>?
          </prompt>
          <filled>
               <if cond="go_ahead">
                    <prompt bargein="false">
                         <audio src="http://www.online-ads.example/wis2.wav"/>
                    </prompt>
                    <submit next="/servlet/weather" namelist="city state"/>
               </if>
               <clear namelist="start city state go_ahead"/>
          </filled>
     </field>
</form>


<form id="weather_info">
     <grammar src="cityandstate.gram" type="application/x-jsgf"/>
     <block>
          <prompt bargein="false"> Welcome to the weather information service.
               <audio src="http://www.online-ads.example/wis.wav"/>
          </prompt>
     </block>
     <initial name="start">
          <prompt> For what city and state would you like the weather? </prompt>
          <help> Please say the name of the city and state for which you you would like a weather report.</help>
          <noinput count="1">
               <reprompt/>
          </noinput>
          <noinput count="2">
               <reprompt/>
               <assign name="start" expr="true"/>
          </noinput>
     </initial>
     <field name="state">
          <prompt>What state?</prompt>
          <help>Please speak the state for which you want the weather.</help>
     </field>
     <field name="city">
          <prompt>Please say the city in
               <value expr="state"/> for which you want the weather.
          </prompt>
          <help>Please speak the city for which you want the weather.</help>
          <filled>
               <if cond="city == 'Los Angeles' && state == undefined">
                    <assign name="state" expr="'California'"/>
               </if>
          </filled>
     </field>
     <field name="go_ahead" type="boolean" modal="true">
          <prompt>Do you want to hear the weather for
               <value expr="city"/>,
               <value expr="state"/>?
          </prompt>
          <filled>
               <if cond="go_ahead">
                    <prompt bargein="false">
                         <audio src="http://www.online-ads.example/wis2.wav"/>
                    </prompt>
                    <submit next="/servlet/weather" namelist="city state"/>
               </if>
               <clear namelist="start city state go_ahead"/>
          </filled>
     </field>
</form>