I have this function:
function validar(e) {
var xx = 1;
tecla = (document.all) ? e.keyCode : e.which; // 2
if (tecla == 8) return true; // 3
patron = /[A-Za-z\s]/; // 4
te = String.fromCharCode(tecla); // 5
var valorNumerico = Number(te);
if (te > 1 && te < 11) {
alert('Calificación:' + valorNumerico)
} else {
alert('La Calificación debe estar entre 2 y 10 - ' + valorNumerico)
}
}
The goal its catch the input the user and validate the range into 2 to 10
But, shows me NaN
I tried valorNumerico = parseInt(te);
Shows me NaN
I tried valorNumerico = Integer.parseInt(te);
Shows me NaN
So, how I can convert to integer? thanks I used a function in javascript into asp.net