Changes between Version 46 and Version 47 of Catalogue


Ignore:
Timestamp:
Jun 26, 2012 11:50:47 PM (12 years ago)
Author:
tolix
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Catalogue

    v46 v47  
    55
    66<script type="text/javascript">
     7
    78  function recalc(el) {
    89    var price = parseFloat(el.parentNode.previousSibling.previousSibling.firstChild.nodeValue.replace(/\s/g, ''));
    910    el.nextSibling.nodeValue = ' = ' + (price * el.value).toFixed(2).toString();
    1011  }
     12
     13  function digitsOnly(evt) {
     14    var theEvent = evt || window.event;
     15    var key = theEvent.keyCode || theEvent.which;
     16    key = String.fromCharCode( key );
     17    var regex = /[0-9]/;
     18    if( !regex.test(key) ) {
     19      theEvent.returnValue = false;
     20      if(theEvent.preventDefault)
     21        theEvent.preventDefault();
     22    }
     23  }
     24
    1125</script>
    1226
     
    5973 <td class="store" align="center">300 руб/мес<sup>1</sup></td>
    6074 <td class="store"> &times; <input name="monitoring_basic" class="shopping-cart-input"
    61   onkeyup="javascript:recalc(this)"></input> </td>
     75  onkeyup="javascript:recalc(this)
     76  onkeypress="javascript:digitsOnly(event)"></input> </td>
    6277</tr>
    6378<tr>