code_junkie

Preventing the loss of keystrokes between pages in a web application

Nov 10th, 2011
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. <html><head>
  2. <script language=javascript>
  3. IE=document.all;
  4. NN=document.layers;
  5. kys="";
  6. if (NN){document.captureEvents(Event.KEYPRESS)}
  7. document.onkeypress=katch
  8. function katch(e){
  9. if (NN){kys+=e.which}
  10. if (IE){kys+=event.keyCode}
  11. document.forms[0].elements[0].value=kys
  12. }
  13. </script>
  14. </head>
  15. <body>
  16. <form><input></form>
  17. </body>
  18. </html>
Add Comment
Please, Sign In to add comment