Changes between Version 49 and Version 50 of Catalogue
- Timestamp:
- Jun 27, 2012 12:18:28 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Catalogue
v49 v50 6 6 <script type="text/javascript"> 7 7 8 function getPrice(el) { 9 return parseFloat(el.parentNode.previousSibling.previousSibling.firstChild.nodeValue.replace(/\s/g, '')); 10 } 11 8 12 function recalc(el) { 9 var price = parseFloat(el.parentNode.previousSibling.previousSibling.firstChild.nodeValue.replace(/\s/g, ''));13 var price = getPrice(el); 10 14 var amountEl = el.nextSibling; 11 15 if( !amountEl ) { … … 14 18 } 15 19 amountEl.nodeValue = ' = ' + (price * el.value).toFixed(2).toString(); 20 updateTotals(); 21 } 22 23 function updateTotals() { 24 var formId = 'catalogue'; 25 var form = document.getElementById(formId); 26 for(el in form) { 27 alert(el); 28 } 16 29 } 17 30 … … 62 75 </style> 63 76 64 <form method="POST">77 <form id="catalogue" method="POST"> 65 78 <input type="hidden" name="order_id" value="%(order_id)s"/> 66 79