0

I have a little curiosity to understand, I've created a responsive site And I used 2 scripts to disable the numeric keys in an input field; The first does not allow the numbers to be entered,The second, a warning message appears that warns you that you can only type alpha characters, I would like to understand why on smartphones only work on firefox while on pc work perfectly: This script disables the numeric keys:

enter code here
function Check(e) {
    var keyCode = (e.keyCode ? e.keyCode : e.which);
    if (keyCode > 47 && keyCode < 58) {
        e.preventDefault();
    }
}

And this makes the message appear:

$(document).ready(function(){
        $(".inputTextBox").keypress(function(event){
            var inputValue = event.which;
            // allow letters and whitespaces only.
            if(!(inputValue >= 65 && inputValue <= 123) && (inputValue != 32 && inputValue != 0)) { 
                event.preventDefault();
                document.getElementById('warning07').style.display='block';
                document.getElementById('07').innerHTML = "Inserire solo lettere!";             
            }
            console.log(inputValue);
        });
    });

Can you explain me? Thanks in advance.

0 Answers0