Motorola 1 manual Option Element

Page 39

VoxML 1.0 Element Reference

OPTION Element

OPTION Element

The OPTION element is used to define the application behavior associated with a specific user response.

The OPTION element can exist only within the INPUT element, and then only when using the OPTIONLIST input type.

Syntax

<OPTION [NEXT="value" [NEXTMETHOD="value"] ] [VALUE="value"] > text </OPTION>

Attributes

Attribute Name

Allowed Values

 

 

VALUE

literal value

 

 

NEXT

next step URL

 

 

NEXTMETHOD

GET *

 

POST

Examples

1 <INPUT NAME="choice" TYPE="optionlist">

2<OPTION NEXT="#doit" VALUE="1"> one </OPTION>

3<OPTION NEXT="#doit" VALUE="2"> two </OPTION>

4</INPUT>

The code on lines 2 and 3 illustrate the use of the OPTION element within the INPUT element. In this example, the OPTION on line 2 would be executed when the user responded with “one”, and the OPTION on line 3 would be executed when the user responded with “two”. If the user said “one” the result would be that the value of the variable named “choice” would be “1”, because of the use of the VALUE attribute. Because the NEXT attributes for both of the OPTIONs in this OPTIONLIST are the same, the VoxML voice browser would proceed to the STEP named “doit” when either “one” or “two” was recognized.

October 1998

VoxML 1.0 Language Reference 35

Image 39
Contents Revision VoxML Language ReferencePage Contents Appendices What is VoxML OverviewPurpose of this Document DIALOGs and STEPs Structure of a VoxML DocumentBasic Elements VoxML 1.0 Application Development Guide Other Reference DocumentationACK Element SyntaxAttributes Examples Audio Element Break Element Next step URL Cancel ElementExamples Case Element Integer Class ElementExamples Dialog Element EMP Element Error Element Input TYPE=OPTIONLIST Help Element Option NEXT=#end done /OPTION 11 /INPUT 12 /STEP Input Element Data Format Input Element Type DateInput Element Type Digits Input Element Type Grammar Input Element Type Hidden Input Element Type Money Input Element Type None Input Element Type Number Input Element Type Optionlist Input Element Type Phone Input Element Type PROFILE‡ Input Element Type Record Prompt Input Element Type Time Input Element Type Yorn Option Element VoxML 1.0 Element Reference Options Element Syntax Attributes Or ElementPrompt Element Pros Element Rename Element Response Element Examples Step Element Switch Element Prompt Value ElementAppendix a VoxML 1.0 Document Type Definition AppendicesOctober VoxML 1.0 Language Reference Vcard Profile Names and Subtypes Appendix B Vcard Profile Names and SubtypesFirst