Hacker News new | ask | show | jobs
by snprbob86 5553 days ago
Beyond that, it's bugged:

    $(".only_numbers").keydown(function(e) {
        var key = e.charCode || e.keyCode || 0;
        // allow backspace, tab, delete, arrows, numbers and keypad numbers ONLY
        return (
           key == 8 || 
           key == 9 ||
           key == 46 ||
           (key >= 37 && key <= 40) ||
           (key >= 48 && key <= 57) ||
           (key >= 96 && key <= 105));
    });
You're able to type ! @ # $ % ^ & * ( ) into .only_numbers boxes.

And you can't press cmd+a to select all, or ctrl+a to go to the beginning of the line, and argh all manner of awful.