24 lines
575 B
Plaintext
Executable File
24 lines
575 B
Plaintext
Executable File
var Validator = {
|
|
catchCtrlCVX: function (e) {
|
|
if(e.ctrlKey==true && e.charCode==99)
|
|
return true;
|
|
if(e.ctrlKey==true && e.charCode==118)
|
|
return true;
|
|
if(e.ctrlKey==true && e.charCode==120)
|
|
return true;
|
|
},
|
|
validateInputNumber: function(e) {
|
|
if (this.catchCtrlCVX(e)){
|
|
return true;
|
|
}
|
|
k = (document.all) ? e.keyCode : e.which;
|
|
if (k == 8) return true;
|
|
if(k >= 96 && k<= 105){
|
|
return true;
|
|
}
|
|
var patron = /\d/;
|
|
var te = String.fromCharCode(k);
|
|
return patron.test(te);
|
|
}
|
|
|
|
}; |