<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML+Voice 1.0/EN" "xhtml+voice.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:vxml="http://www.w3.org/2001/vxml"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xv="http://www.voicexml.org/2002/xhtml+voice">

<head>
  <title> MM Online Payment </title>
  <xv:sync xv:input="recipientGUI" xv:field="#recipient"/>
  <xv:sync xv:input="amountGUI" xv:field="#amount"/>

  <vxml:form id="payment"> 
	<vxml:block> Welcome to online payment</vxml:block> 


    <vxml:field name="recipient" xv:id="recipient"> 	
          <vxml:grammar type="application/x-jsgf"> 
               <![CDATA[
                    grammar companies;
                    public <companies> = ajax | superstore;
               ]]>  
          </vxml:grammar>
          <vxml:prompt>Who do you want to pay, Ajax or Superstore?</vxml:prompt>
     </vxml:field>

     <vxml:field name="amount" xv:id="amount" >
          <vxml:grammar type="application/x-jsgf">
               <![CDATA[
                    grammar amount;
                    public <amount> = 10 | 20 | 30 | 40;
               ]]> 
          </vxml:grammar>
          <vxml:prompt>How much do you want to pay, 10, 20, 30, or 40? </vxml:prompt>
     </vxml:field> 

     <vxml:field name="validate" >
          <vxml:grammar type="application/x-jsgf">
               <![CDATA[
                    grammar yes_no;
                    public <yes_no> = yes | no ;
               ]]> 
          </vxml:grammar>
          <vxml:prompt>	
              Do you want to pay <vxml:value expr="amount"/>
              to <vxml:value expr="recipient"/>
          </vxml:prompt>
     </vxml:field> 

     <vxml:filled> 
          <vxml:if cond = "validate == 'no'"> 
               <vxml:prompt> 
                    Sorry, your request has been canceled. 
               </vxml:prompt> 
               <vxml:clear namelist = "recipient amount validate"/> 
               <!-- because the variables have been cleared, the	
                    Form Interpretation Algorithm processes the form again -->		
          <vxml:else/> 	
               <vxml:prompt>
                    Your transaction has been submitted 
                </vxml:prompt>	
               <!-- interaction with transaction results go here -->	
          </vxml:if> 	
     </vxml:filled>

  </vxml:form>                                                     
</head> 


<body  ev:event="load" ev:handler="#payment"> 
<h1>Online Payment</h1>
<p>This is a multimodal application for paying Ajax or Superstore an amount of 10, 20, 30, or 40</p>
<form>
     Recipient
     <select name="recipientGUI"> 
         <option value = "Ajax">Ajax</option>
         <option value = "Superstore">Superstore</option>
     </select>
     Amount
     <select name="amountGUI"> 
         <option value = "10">10</option>
         <option value = "20">20</option>
         <option value = "30">30</option>
         <option value = "40">40</option>
     </select>
</form>
</body>
</html>
