984008ddefe35288eab3334909440d9641161b75
[myslice.git] / third-party / jquery-ui-1.10.2 / tests / visual / dialog / form.html
1 <!doctype html>
2 <html lang="en">
3 <head>
4         <meta charset="utf-8">
5         <title>Dialog Visual Test</title>
6         <link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css">
7         <script src="../../../jquery-1.9.1.js"></script>
8         <script src="../../../ui/jquery.ui.core.js"></script>
9         <script src="../../../ui/jquery.ui.widget.js"></script>
10         <script src="../../../ui/jquery.ui.mouse.js"></script>
11         <script src="../../../ui/jquery.ui.draggable.js"></script>
12         <script src="../../../ui/jquery.ui.position.js"></script>
13         <script src="../../../ui/jquery.ui.resizable.js"></script>
14         <script src="../../../ui/jquery.ui.button.js"></script>
15         <script src="../../../ui/jquery.ui.dialog.js"></script>
16         <script src="../../../ui/jquery.ui.effect.js"></script>
17         <script src="../../../ui/jquery.ui.effect-blind.js"></script>
18         <script src="../../../ui/jquery.ui.effect-explode.js"></script>
19         <script>
20         $(function() {
21                 $( "#form-dialog, #prompt-dialog" ).dialog({
22                         autoOpen: false,
23                         modal: true
24                 });
25
26                 $( "#open-form" ).click(function() {
27                         $( "#form-dialog" ).dialog( "open" );
28                 });
29
30                 $( "#open-prompt" ).click(function() {
31                         $( "#prompt-dialog" ).dialog( "open" );
32                 });
33         });
34         </script>
35         <style>
36         label {
37                 display: block;
38         }
39         </style>
40 </head>
41 <body>
42
43 <p>WHAT: A modal dialog containing form fields, with groups to describe each section. A second modal dialog with just an input and some text markup.</p>
44 <p>EXPECTED: Dialog shows up, screenreader reads the dialog's title, the word "dialog" (or equivalent), the text before the first input (description of the first section) and the label of the first, focused input. When tabbing to the next group, the screenreader should announce the description of that group, along with the label of the focused field.</p>
45 <p>For the second dialog, the behaviour should be similar, except that the whole content is read as the description of the dialog, likely causing the input's label to be read twice.</p>
46 <p>NOTE: Using <code>fieldset</code> with <code>legend</code> seems to have the same result as using <code>role="group"</code> and <code>aria-describedby</code>. The latter needs an id-attribute, offers more flexibilty in markup order and has no built-in styling.</p>
47
48 <div id="form-dialog" title="Profile Information">
49         <fieldset>
50                 <legend>Please share some personal information</legend>
51                 <label for="favorite-animal">Your favorite animal</label><input id="favorite-animal">
52                 <label for="favorite-color">Your favorite color</label><input id="favorite-color">
53         </fieldset>
54         <div role="group" aria-describedby="section2">
55                 <p id="section2">Some more (optional) information</p>
56                 <label for="favorite-food">Favorite food</label><input id="favorite-food">
57         </div>
58 </div>
59
60 <button id="open-form">Open Form Dialog</button>
61
62 <div id="prompt-dialog" title="Are you sure?">
63         <p>Please enter password to continue.</p>
64         <label for="password">Password</label><input id="password">
65 </div>
66
67 <button id="open-prompt">Open Prompt Dialog</button>
68
69 </body>
70 </html>