File tree Expand file tree Collapse file tree
Standards/WCAG2AAA/Sniffs/Principle3/Guideline3_2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,28 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle3_Guideline3_2_3_2_2 = {
6565 }
6666 } //end if
6767
68+ if ( ok === false ) {
69+ // Look for buttons with form attributes, outside of the form.
70+ if ( form . id ) {
71+ var externalButtons = document . querySelectorAll ( 'button[form], input[form][type=submit], input[form][type=image]' ) ;
72+ externalButtons . forEach (
73+ function ( el ) {
74+ // Check they aren't reset buttons, or normal buttons.
75+ switch ( el . getAttribute ( 'type' ) ) {
76+ case 'reset' :
77+ case 'button' :
78+ return ;
79+ }
80+
81+ // Confirm they are associated with the form.
82+ if ( el . attributes [ 'form' ] . value === form . id ) {
83+ ok = true ;
84+ }
85+ }
86+ ) ;
87+ }
88+ }
89+
6890 if ( ok === false ) {
6991 HTMLCS . addMessage (
7092 HTMLCS . ERROR ,
Original file line number Diff line number Diff line change 77Standard: WCAG2AAA
88Assert: Error *.H32.2 on #missingSubmit
99Assert: No Error *.H32.2 on #defaultSubmitType
10+ Assert: No Error *.H32.2 on #externalSubmitType
1011-->
1112</ head >
1213< body >
1718 < button > Submit</ button >
1819</ form >
1920
21+ < form id ="externalSubmitType "> </ form >
22+ < button form ="externalSubmitType "> Submit</ button >
23+
2024</ body >
2125</ html >
You can’t perform that action at this time.
0 commit comments