<option>

Specifies an option in a <field>.

Syntax

 <option
     accept="exact"|"approximate"
     value="string"
     dtmf="dtmf_sequence"
 >
   Option Text
 </option>

Description

Provide one of a simple set of alternatives within a field without specifying a grammar. A grammar for the field is generated automatically, based on the option list. You can use <enumerate> to generate prompts automatically based on option lists as well.

Attribute Description
accept

New in VoiceXML 2.0. Specifies whether the default grammar generated for this <choice> element requires all words or accepts a subset of the words; overrides the accept attribute of the parent <menu> element.

 •  exact--Requires the user to say the exact phrase that appears in the <choice> element.
 •  approximate--Allows the user to say a subset of the words in the <choice> element.

Note: The default is exact if the version attribute of the containing <vxml> element specifies 2.0 or greater. For backward compatibility, the default is approximate if the version attribute is less than 2.0 or unspecified.

value

String to assign to the input variable when this item is selected. Optional (default is the value of the dtmf attribute, if any, otherwise, the option text itself with leading and trailing white space removed).

dtmf

DTMF sequence to assign to this option. Optional.

Usage

Parents Children
<field>

None.

See Also

 •  VoiceXML 2.0 Specification: <option>
 •  Related tags: <field>, <choice>, <enumerate>

Examples

 <?xml version="1.0" ?>
 <!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN"
  "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
 
 <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
   <form id="mainform">
     <block name="welcome">
       This is a test of the option tag.
     </block>
     <catch event="nomatch noinput">
       <prompt> Sorry, I didn't understand. </prompt>
       <reprompt/>
     </catch>
     <field name="mainmenu">
       <prompt>
         Please select an application from the list of 
         <enumerate/>
       </prompt>
       <option value="Directions">Driving Directions </option>
       <option value="Portfolio">Stock Quotes </option>
       <option value="Stores">Business Finder </option>
       <filled>
         <prompt>You chose <value expr="mainmenu"/> </prompt>
       </filled>
     </field>
   </form>
 </vxml>

[Show Frames]   [FIRST] [PREVIOUS] [NEXT]
BeVocal, Inc. Café Home | Developer Agreement | Privacy Policy | Site Map | Terms & Conditions
Part No. 520-0001-02 | © 1999-2007, BeVocal, Inc. All rights reserved | 1.877.33.VOCAL