option element
VoiceXML 2.0
Specifies an option to a user within a field.


dtmf = "integer"
value = "string"

A DTMF digit for this option.
The string to assign to the field variable when user input (speech or DTMF) matches the grammar fragment defined as the element content or the DTMF sequence specified by the dtmf attribute. If you do not specify a value string, the dtmf value is returned to the field variable when there is a recognition match. Otherwise, the value string is returned when a recognition match occurs. ( if dtmf not -specified; can use both)



The option element specifies a speech or DTMF grammar fragment and a string to assign to the field variable when a recognition match occurs. The option element is a convenient way to define a simple set of options for a user within the field element, replacing the need for an active grammar. You may also specify a grammar, in which case the recognition result from the matched grammar is returned to the field variable.

In the following example the enumerate element lists the options to the user. The value attribute determines what is returned by the recognizer, and the text inside the element defines what the user can say.

<?xml version="1.0"?>
<vxml version="2.1"
   <form id="pick_city">
      <field name="city">
            Choose one of the seven following destinations
            <!-- list the options -->

         <option dtmf="1" value="delhi"> Deli India </option>
         <option dtmf="2" value="tokyo"> Tokyo Japan </option>
         <option dtmf="3" value="beijing"> Beijing China </option>
         <option dtmf="4" value="calcutta"> Calcutta India </option>
         <option dtmf="5" value="hong_kong"> Hong Kong </option>
         <option dtmf="6" value="london"> London Great Britain </option>
         <option dtmf="7" value="paris"> Paris France </option>

             have fun in <value expr="city"/> 
            <exit />

[24]7 Inc.| Terms of Service| Privacy Policy| General Disclaimers