Advertisement
richarduie

pageForward.html

Apr 4th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4. <!---
  5. pass key/value pairs from text inputs of form in this page to
  6. populate an identically structured form in another page
  7.  
  8. parameterized HTTP GET request will be employed to pass the
  9. key/value pairs - WARNING GET URLs are limited to maximum
  10. lengths that vary by server and browser...don't expect to be
  11. able to pass more than 2048 bytes in total
  12. -->
  13. <script type="text/javascript">
  14. function goHome( btnRef ) {
  15. // reset target URL for HTTP request
  16. document.myForm.action = "pageReceive.html";
  17. // change method from post to get
  18. document.myForm.method = "get";
  19. // invoke form's submit() method
  20. document.myForm.submit();
  21. };
  22. </script>
  23. </head>
  24.  
  25. <body>
  26. <form name="myForm" action="someOtherPage.html" method="post">
  27. <p>
  28. <input type="text" name="key1" value="value1" />
  29. <input type="text" name="key2" value="value2" />
  30. <input type="text" name="key3" value="value3" />
  31. <input type="text" name="key4" value="value4" />
  32. <input type="button" name="btnHome" value="send to home page"
  33. onclick="goHome()" />
  34. <input type="submit" />
  35. </p>
  36. </form>
  37. </body>
  38.  
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement