Changes between Version 49 and Version 50 of Catalogue


Ignore:
Timestamp:
Jun 27, 2012 12:18:28 AM (13 years ago)
Author:
tolix
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Catalogue

    v49 v50  
    66<script type="text/javascript">
    77
     8  function getPrice(el) {
     9    return parseFloat(el.parentNode.previousSibling.previousSibling.firstChild.nodeValue.replace(/\s/g, ''));
     10  }
     11
    812  function recalc(el) {
    9     var price = parseFloat(el.parentNode.previousSibling.previousSibling.firstChild.nodeValue.replace(/\s/g, ''));
     13    var price = getPrice(el);
    1014    var amountEl = el.nextSibling;
    1115    if( !amountEl ) {
     
    1418    }
    1519    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    }
    1629  }
    1730
     
    6275</style>
    6376
    64 <form method="POST">
     77<form id="catalogue" method="POST">
    6578<input type="hidden" name="order_id" value="%(order_id)s"/>
    6679