Guest User

Untitled

a guest
Jul 28th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script text/javascript>
  4. var inputs = document.getElementsByTagName("input");
  5. function checkTabPress(e)
  6. {
  7.  
  8. for(var i=0;i<inputs.length;i++)
  9. {
  10. if((inputs[i].value === undefined || inputs[i].value.length == 0) && (e.keyCode == 9))
  11. {
  12. alert("plz write");
  13. return false;
  14.  
  15. }
  16.  
  17.  
  18. }
  19. return true;
  20. }
  21.  
  22. document.addEventListener('keyup', function (e) {
  23. checkTabPress(e);
  24. }, false);
  25. </script>
  26. </head>
  27. <body>
  28. Enter Your Name: <input onkeypress="checkTabPress('abc')" type='text' id="abc" placeholder=''><br>
  29. Enter <input onkeypress="checkTabPress('xyz')" type='text' id="xyz" placeholder=''>
  30. </body>
  31. </html>
Add Comment
Please, Sign In to add comment