Changes between Version 46 and Version 47 of Catalogue
- Timestamp:
- Jun 26, 2012 11:50:47 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Catalogue
v46 v47 5 5 6 6 <script type="text/javascript"> 7 7 8 function recalc(el) { 8 9 var price = parseFloat(el.parentNode.previousSibling.previousSibling.firstChild.nodeValue.replace(/\s/g, '')); 9 10 el.nextSibling.nodeValue = ' = ' + (price * el.value).toFixed(2).toString(); 10 11 } 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 11 25 </script> 12 26 … … 59 73 <td class="store" align="center">300 руб/мес<sup>1</sup></td> 60 74 <td class="store"> × <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> 62 77 </tr> 63 78 <tr>