Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / textarea-setvalue-submit.html
blob23f8b8659698f67f6f4c335d8f4cd6c1bbaff3fd
1 <html>
2 <head>
3 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
4 <title>Charsets and submitting forms</title>
5 </head>
6 <body>
7 <form name="f" method="?" action="textarea-setvalue-submit.html">
8 <textarea id="textarea1" name="textarea1">default value</textarea>
9 <textarea id="textarea2" name="textarea2" style="display:none">default value</textarea>
10 </form>
11 <script>
13 if (document.URL.indexOf('?') == -1) {
15 if (window.testRunner) {
16 window.testRunner.dumpAsText();
17 window.testRunner.waitUntilDone();
20 var textarea1 = document.getElementById("textarea1");
21 textarea1.value = "new value";
22 var textarea2 = document.getElementById("textarea2");
23 textarea2.value = "new value";
25 document.f.submit();
27 } else {
28 var formData = document.URL.substring(document.URL.indexOf('?') + 1, document.URL.length);
29 var expected = "textarea1=new+value&textarea2=new+value";
30 if (formData == expected)
31 document.write("Success");
32 else
33 document.write("Failure. The value set in the textarea via javascript wasn't sent when the form was submitted. Expected: " + expected + ", Found: " + formData);
35 if (window.testRunner)
36 window.testRunner.notifyDone();
39 </script>
40 </body>
41 </html>