Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== < if > ====== ===== Description ===== The < if > element defines if-then-else conditional logic. ===== Syntax ===== <code> <if cond="ECMAScript_Expression"> child elements </if> </code> ===== Attributes ===== |cond|The cond attribute is a Boolean expression for the conditional logic statement. This attribute is required.| ===== Parents ===== <code> <block>, <catch>, <error>, <filled>, <help>, <if>, <noinput>, <nomatch> </code> ===== Children ===== <code> <assign>, <audio>, <clear>, <disconnect>, <else>, <elseif>, <enumerate>, <exit>, <goto>, <if>, <prompt>, <reprompt>, <return>, <script>, <submit>, <throw>, <value>, <var> </code> ===== Extensions ===== <code> None. </code> ===== Limitations/Restrictions ===== <code> None. </code> ===== Example Code ===== <code> <?xml version="1.0"?> <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml"> <var name="card_type" expr="'amex'" /> <form> <field name="card_num" type="digits"> <prompt>What is your card number?</prompt> <filled> <if cond="card_type == 'amex' && card_num.length != 15"> American Express card numbers must have 15 digits. <clear namelist="card_num"/> <elseif cond="card_type != 'amex' && card_num.length != 16"/> Mastercard and Visa card numbers have 16 digits. <clear namelist="card_num"/> </if> </filled> </field> </form> </vxml> </code> legacy/vxi_developer_guide/voicexml_references/elements/if.txt Last modified: 2017/07/28 23:53by javier