1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <title>required and valueMissing on disabled elements
</title>
5 <script src=
"../../resources/js-test.js"></script>
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
>
14 <select id=
"select-placeholder-selected" name=
"victim" disabled required
>
15 <option value=
"" selected
/>
16 <option value=
"X">X
</option>
18 <select id=
"select-without-placeholder" name=
"victim" disabled required
>
19 <option value=
"X">X
</option>
20 <option value=
"" selected
/>
22 <select id=
"select-placeholder-selected-size2" name=
"victim" size=
"2" disabled required
>
23 <option value=
"" selected
/>
24 <option value=
"X">X
</option>
26 <select id=
"select-without-placeholder-size2" name=
"victim" size=
"2" disabled required
>
27 <option value=
"X">X
</option>
28 <option value=
"" selected
/>
30 <select id=
"select-none-selected-multiple" name=
"victim" multiple disabled required
>
32 <option value=
"X">X
</option>
34 <select id=
"select-fake-placeholder-selected-multiple" name=
"victim" multiple disabled required
>
35 <option value=
"" selected
/>
36 <option value=
"X">X
</option>
38 <select id=
"select-without-fake-placeholder-multiple" name=
"victim" multiple disabled required
>
39 <option value=
"X">X
</option>
40 <option value=
"" selected
/>
42 <select id=
"select-none-selected-size2-multiple" name=
"victim" multiple
size=
"2" disabled required
>
44 <option value=
"X">X
</option>
46 <select id=
"select-fake-placeholder-selected-size2-multiple" name=
"victim" multiple
size=
"2" disabled required
>
47 <option value=
"" selected
/>
48 <option value=
"X">X
</option>
50 <select id=
"select-without-fake-placeholder-size2-multiple" name=
"victim" multiple
size=
"2" disabled required
>
51 <option value=
"X">X
</option>
52 <option value=
"" selected
/>
54 <script language=
"JavaScript" type=
"text/javascript">
55 function valueMissingFor(id
) {
56 return document
.getElementById(id
).validity
.valueMissing
;
59 description("This test checks validity.valueMissing of disabled form controls with blank values, blank options selected, or nothing selected.");
61 v
= document
.getElementsByName("victim");
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-multiple")');
75 shouldBeFalse('valueMissingFor("select-without-fake-placeholder-size2-multiple")');