[Zope] Calculation with DTML/form

Chan YH cyhoong@pc.jaring.my
Wed, 9 Jul 2003 16:59:35 +0800


I appreciate if someone can show me how to do calculations in DTML.
I am having a problem with Total variable in the example below.

TQ in advance. 


Data_form
 -----------
 <form method="post" action="Data_validate">
 <table>
   <tr><td> Enter quantity: </td>
       <td><input type="int" name="quantity" value="1" /></td>
   </tr>
   <tr><td> Enter Price: </td>
       <td><input type="int" name="price" value="1" /></td>
   </tr>
   <tr>
       <td><input type="submit" name="submit" value="Submit" /></td>
   </tr>
 </table>
 
 
 Data_validate Method
 ----------------------
   Price is <dtml-var price> <br />
   Quantity is <dtml-var quantity> <br />
 
   Total is <dtml-let expr="Total=price * quantity"></dtml-let> <br />