Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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>
Add Comment
Please, Sign In to add comment