Is there any way by which I can enable onkeypress event in opera mini for mobile? It works in almost all browsers, 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>
source share