4

Is there any way by which I can enable onkeypress event in opera mini for mobile? its working in almost all browser but not in opera mini.

My code is:

 <pre>
    <script type="text/javascript">        
    function doCheck(field) {
      if (isNaN(document.getElementById(field).value)) {
        alert('This is not a number! Please enter a valid number before submitting the form.');
        document.getElementById(field).focus();
        document.getElementById(field).select(); 
        return false;
      }else {
        return true;
      }
    }

    function abc(){         
      var a;
      a = document.getElementById('inp').value;        
      if(isNaN(a)){
        alert("you can write only numbers");
        document.getElementById('inp').value = "";
      }
    }
    </script>        
  </pre>
Igor Milla
  • 2,767
  • 4
  • 36
  • 44
Rikin Thakkar
  • 1,268
  • 3
  • 13
  • 27

1 Answers1

2

as far as i know, Opera Mini only has limited JS support (and onKeyPress isn't one of them)

Joseph
  • 117,725
  • 30
  • 181
  • 234