Changeset 6559


Ignore:
Timestamp:
Oct 10, 2014, 8:49:47 AM (8 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1865: Allow LEFT, RIGHT and DELETE keys in numeric fields

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-stable/www/include/scripts/main-2.js

    r6555 r6559  
    755755  events.integerOnly = function(event)
    756756  {
    757     var charCode = event.charCode || event.keyCode;
     757    var charCode = event.charCode;
    758758    // <31 for tab, delete, etc. 48-57=key 0-9, 45= '-'
    759759    var allow = charCode <= 31 || (charCode >= 48 && charCode <= 57) || charCode == 45;
     
    767767  events.numberOnly = function(event)
    768768  {
    769     var charCode = event.charCode || event.keyCode;
     769    var charCode = event.charCode;
    770770    // <31 for tab, delete, etc. 48-57=key 0-9, 45= '-', 46='.', 69/101=E/e
    771771    var allow = charCode <= 31 || (charCode >= 48 && charCode <= 57) || charCode == 45 || charCode == 46 || charCode == 69 || charCode == 101;
Note: See TracChangeset for help on using the changeset viewer.