Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer_guide:voicexml_references:elements:clear [2015/10/13 21:42] (current)
borja created
Line 1: Line 1:
 +====== < clear > ======
  
 +===== Description =====
 +The < clear > element resets one or more form items and will perform the following actions:
 +* Sets the form item variable to ECMAScript undefined.
 +* Reinitializes the prompt and event counters for the form item.
 +
 +===== Syntax =====
 +<​code>​
 +<clear
 +namelist="​item1 item2 item3 ..."/>​
 +</​code>​
 +
 +===== Attributes =====
 +|namelist|The namelist attribute defines the names of the form items to be cleared. ​ When not specified, all of the form items in the current form are cleared. ​ This attribute is optional.|
 +
 +===== Parents =====
 +<​code>​
 +<​block>,​ <​catch>,​ <​error>,​ <​filled>,​ <​help>,​ <if>, <​noinput>,​ <​nomatch>​
 +</​code>​
 +
 +===== Children =====
 +<​code>​
 +None.
 +</​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">​
 + <​form>​
 +  <field name="​password">​
 +   <​prompt>​ what is the code word </​prompt>​
 +   <​help>​ It is the name of a fruit </​help>​
 +   <​noinput>​ I did not hear you. </​noinput>​
 +   <​nomatch count="​1">​ Noop. Try again </​nomatch>​
 +   <​nomatch count="​2">​ Noop. give another try </​nomatch>​
 +   <​nomatch count="​3">​
 +    Sorry. You didn't get it for three times. Bye
 +    <​disconnect/>​
 +   </​nomatch>​
 +   <​filled>​
 +    <if cond="​password=='​reset'">​
 +     <​clear namelist="​password"/>​
 +    <​else/>​
 +     This is correct.
 +    </if>
 +   </​filled>​
 +  </​field>​
 + </​form>​
 +</​vxml>​
 +</​code>​