File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1313 < h1 > auto-check-element</ h1 >
1414 < h2 > Simple form</ h2 >
1515 < p > Input 422 for an error response.</ p >
16+ < p id ="success1 " class ="success " hidden > Your submission was successful</ p >
1617 < form >
1718 < p > All fields marked with * are required</ p >
1819
@@ -21,11 +22,12 @@ <h2>Simple form</h2>
2122 < input id ="simple-field " autofocus name ="foo " required />
2223 < code class ="state "> </ code >
2324 </ auto-check >
24- < button > submit</ button >
25+ < button value =" 1 " name =" form " > submit</ button >
2526 </ form >
2627
2728 < h2 > Form that has custom validity messages</ h2 >
2829 < p > Input 422 for an error response.</ p >
30+ < p id ="success2 " class ="success " hidden > Your submission was successful</ p >
2931 < form id ="custom ">
3032 < p > All fields marked with * are required</ p >
3133
@@ -34,11 +36,13 @@ <h2>Form that has custom validity messages</h2>
3436 < input id ="custom-field " autofocus class ="json " name ="foo " required />
3537 < code class ="state "> </ code >
3638 </ auto-check >
37- < button > submit</ button >
39+ < button value =" 2 " name =" form " > submit</ button >
3840 </ form >
3941 </ main >
4042
4143 < script >
44+ let successN = new URL ( window . location ) . searchParams . get ( 'form' )
45+ if ( successN ) document . getElementById ( `success${ successN } ` ) . hidden = false
4246 let focusedInput
4347 const nativeFetch = window . fetch
4448 const fakeFetch = function ( _ , options ) {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class AutoCheckValidationEvent extends AutoCheckEvent {
3030 super ( phase )
3131 }
3232
33- setValidity ( message : string ) {
33+ setValidity = ( message : string ) => {
3434 this . message = message
3535 }
3636}
You can’t perform that action at this time.
0 commit comments