OLD | NEW |
| (Empty) |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
2 <html> | |
3 <head> | |
4 <title>required and valueMissing on disabled elements</title> | |
5 <script src="../../resources/js-test.js"></script> | |
6 </head> | |
7 <body> | |
8 <p id="description"></p> | |
9 <div id="console"></div> | |
10 <input id="input" name="victim" disabled required /> | |
11 <textarea id="textarea" name="victim" disabled required></textarea> | |
12 <select id="select-no-option" name="victim" disabled required> | |
13 </select> | |
14 <select id="select-placeholder-selected" name="victim" disabled required> | |
15 <option value="" selected /> | |
16 <option value="X">X</option> | |
17 </select> | |
18 <select id="select-without-placeholder" name="victim" disabled required> | |
19 <option value="X">X</option> | |
20 <option value="" selected /> | |
21 </select> | |
22 <select id="select-placeholder-selected-size2" name="victim" size="2" disabled r
equired> | |
23 <option value="" selected /> | |
24 <option value="X">X</option> | |
25 </select> | |
26 <select id="select-without-placeholder-size2" name="victim" size="2" disabled re
quired> | |
27 <option value="X">X</option> | |
28 <option value="" selected /> | |
29 </select> | |
30 <select id="select-none-selected-multiple" name="victim" multiple disabled requi
red> | |
31 <option value="" /> | |
32 <option value="X">X</option> | |
33 </select> | |
34 <select id="select-fake-placeholder-selected-multiple" name="victim" multiple di
sabled required> | |
35 <option value="" selected /> | |
36 <option value="X">X</option> | |
37 </select> | |
38 <select id="select-without-fake-placeholder-multiple" name="victim" multiple dis
abled required> | |
39 <option value="X">X</option> | |
40 <option value="" selected /> | |
41 </select> | |
42 <select id="select-none-selected-size2-multiple" name="victim" multiple size="2"
disabled required> | |
43 <option value="" /> | |
44 <option value="X">X</option> | |
45 </select> | |
46 <select id="select-fake-placeholder-selected-size2-multiple" name="victim" multi
ple size="2" disabled required> | |
47 <option value="" selected /> | |
48 <option value="X">X</option> | |
49 </select> | |
50 <select id="select-without-fake-placeholder-size2-multiple" name="victim" multip
le size="2" disabled required> | |
51 <option value="X">X</option> | |
52 <option value="" selected /> | |
53 </select> | |
54 <script language="JavaScript" type="text/javascript"> | |
55 function valueMissingFor(id) { | |
56 return document.getElementById(id).validity.valueMissing; | |
57 } | |
58 | |
59 description("This test checks validity.valueMissing of disabled form control
s with blank values, blank options selected, or nothing selected."); | |
60 | |
61 v = document.getElementsByName("victim"); | |
62 | |
63 shouldBeFalse('valueMissingFor("input")'); | |
64 shouldBeFalse('valueMissingFor("textarea")'); | |
65 shouldBeFalse('valueMissingFor("select-no-option")'); | |
66 shouldBeFalse('valueMissingFor("select-placeholder-selected")'); | |
67 shouldBeFalse('valueMissingFor("select-without-placeholder")'); | |
68 shouldBeFalse('valueMissingFor("select-placeholder-selected-size2")'); | |
69 shouldBeFalse('valueMissingFor("select-without-placeholder-size2")'); | |
70 shouldBeFalse('valueMissingFor("select-none-selected-multiple")'); | |
71 shouldBeFalse('valueMissingFor("select-fake-placeholder-selected-multiple")'
); | |
72 shouldBeFalse('valueMissingFor("select-without-fake-placeholder-multiple")')
; | |
73 shouldBeFalse('valueMissingFor("select-none-selected-size2-multiple")'); | |
74 shouldBeFalse('valueMissingFor("select-fake-placeholder-selected-size2-multi
ple")'); | |
75 shouldBeFalse('valueMissingFor("select-without-fake-placeholder-size2-multip
le")'); | |
76 </script> | |
77 </body> | |
78 </html> | |
OLD | NEW |