Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <!---
- pass key/value pairs from text inputs of form in this page to
- populate an identically structured form in another page
- parameterized HTTP GET request will be employed to pass the
- key/value pairs - WARNING GET URLs are limited to maximum
- lengths that vary by server and browser...don't expect to be
- able to pass more than 2048 bytes in total
- -->
- <script type="text/javascript">
- function goHome( btnRef ) {
- // reset target URL for HTTP request
- document.myForm.action = "pageReceive.html";
- // change method from post to get
- document.myForm.method = "get";
- // invoke form's submit() method
- document.myForm.submit();
- };
- </script>
- </head>
- <body>
- <form name="myForm" action="someOtherPage.html" method="post">
- <p>
- <input type="text" name="key1" value="value1" />
- <input type="text" name="key2" value="value2" />
- <input type="text" name="key3" value="value3" />
- <input type="text" name="key4" value="value4" />
- <input type="button" name="btnHome" value="send to home page"
- onclick="goHome()" />
- <input type="submit" />
- </p>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement