| 123456789101112131415161718192021222324252627282930313233 |
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>036a post</title>
- <style>
- html, body { margin: 0; padding: 0; background: #ffffff; color: #202020; }
- body { font-family: sans-serif; font-size: 13px; padding: 10px; }
- h1 { font-size: 20px; margin: 0 0 6px 0; }
- p { margin: 0 0 10px 0; }
- label { margin-right: 8px; }
- input, button { font-family: sans-serif; font-size: 13px; }
- </style>
- </head>
- <body>
- <h1>036a · POST form submission</h1>
- <p>This local page cannot POST; it redirects the form to the test server.</p>
- <form id="f" method="post" action="http://10.0.2.2:8765/echo">
- <label>Alpha <input id="alpha" name="alpha" value="one"></label>
- <label><input id="beta" name="beta" type="checkbox"> Beta</label>
- <button id="go" type="submit" name="send" value="yes">Send</button>
- </form>
- <p>The script sets the fields and submits via <code>form.submit()</code>.</p>
- <script>
- setTimeout(function () {
- var f = document.getElementById('f');
- document.getElementById('alpha').value = 'two';
- document.getElementById('beta').checked = true;
- f.submit();
- }, 700);
- </script>
- </body>
- </html>
|