tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / forms / formaction-attribute.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <form action="javascript: failTest(this)" method="get">
10 <input id="button1" type="submit" formaction="javascript: passTest1(this)" />
11 <button id="button2" type="submit" formaction="javascript: passTest2(this)" />
12 </form>
13 <script>
14 description("Test for formaction attributes in input and button tags.");
15 var doneAction = false;
16 var doneAction2 = false;
17
18 function failTest(ul)
19 {
20     doneAction = true;
21     testFailed('The formaction attribute in the input or button tag was ignored.');
22 }
23 function passTest1(ul)
24 {
25     doneAction = true;
26     testPassed('The formaction attribute in the input tag was used.');
27 }
28 function passTest2(ul)
29 {
30     doneAction = true;
31     testPassed('The formaction attribute in the button tag was used.');
32 }
33
34 doneAction = false;
35 var input = document.getElementById('button1');
36 input.click();
37 if (!doneAction)
38     testFailed('Both of the action and the formaction attributes were ignored.');
39
40 doneAction = false;
41 var button = document.getElementById('button2');
42 button.click();
43 if (!doneAction)
44     testFailed('Both of the action and the formaction attributes were ignored.');
45 </script>
46 <script src="../../fast/js/resources/js-test-post.js"></script>
47 </body>
48 </html>