when am trying to validate the jsp form on keypress event , it shows alert box first before entering any data onto input field? :     <html>
    <head>
    <script text/javascript>
    var inputs = document.getElementsByTagName("input");
    function checkTabPress(e) 
    {
    	
      for(var i=0;i<inputs.length;i++)
     {
       if((inputs[i].value === undefined || inputs[i].value.length == 0) && (e.keyCode == 9))
    	{
    	  alert("plz write");
    	  return false;
    	 
    	}
    	
    	
     } 
    	return true;
    }
       
    document.addEventListener('keyup', function (e) {
        checkTabPress(e);
    }, false);
    </script>
    </head>
    <body>
    Enter Your Name: <input onkeypress="checkTabPress('abc')" type='text' id="abc" placeholder=''><br>
    Enter <input onkeypress="checkTabPress('xyz')" type='text' id="xyz" placeholder=''>
    </body>
    </html>

please help to resolve the issue..

Thank you


reply as soon as possible Please...


It looks like your post is mostly code; please add some more details.





