<if>
<if>
Attributes
Name
Data type
Description
String
Notes
<if cond="number==5">
<!-- do something -->
<elseif cond="number==2"/>
<!-- do something else -->
<else/>
<!-- do something for all other cases -->
</if><if cond="number==5">
<!-- do something -->
<elseif cond="number==2">
<!-- this won't work since we left off the / -->
<else>
<!-- this also won't work since we left off the / -->
</if>Example
<?xml version="1.0"?>
<vxml version="2.0">
<form>
<field name="myprompt" type="digits">
<prompt>
Say the magic number between 1 and 9.
</prompt>
<filled>
<!-- The "cond" attribute within an "if" tag -->
<!-- should contain a boolean ECMAscript expression. -->
<if cond="myprompt==5">
<prompt>
You guessed correctly!
</prompt>
<elseif cond="myprompt==4 || myprompt==6"/>
<prompt>
You're close. Try again.
</prompt>
<clear namelist="myprompt"/>
<else/>
<prompt>
Try again.
</prompt>
<clear namelist="myprompt"/>
</if>
</filled>
</field>
</form>
</vxml>Child Tags
Parent Tags
Last updated