Advertisement
JackHaxor

Test Html Send

Aug 8th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <title>Jack HaXOr</title>
  7. </head>
  8. <body>
  9. <form action="/" method="get" accept-charset="utf-8" id="form">
  10. <input type="text" name="x" id="x" placeholder="Enter something here..." autofocus required>
  11. <button type="submit">GO</button>
  12. </form>
  13. <script>
  14. let form = document.getElementById('form');
  15. form.addEventListener('submit', function(e) {
  16. e.preventDefault();
  17.  
  18. let id = document.getElementById('x').value;
  19. if (id && id !== '') {
  20. window.top.location.href = 'https://example.com/' + id;
  21. }
  22. }, false);
  23. </script>
  24. </body>
  25. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement