File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed
static/usage/v8/toggle/helper-error Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change 1717 </ head >
1818
1919 < body >
20- < div class =" container " >
21- < form id =" my-form " >
22- < ion-toggle helper-text =" This needs to be enabled " error-text =" This field is required " > Wi-Fi </ ion-toggle >
23-
24- < br / >
20+ < style >
21+ ion-toggle {
22+ width : 300 px ;
23+ }
24+ </ style >
2525
26- < ion-button type =" submit " size =" small " > Submit </ ion-button >
27- </ form >
26+ < div class =" container " >
27+ < ion-toggle helper-text =" Enable to connect to available networks " error-text =" Must be enabled to access the internet " checked > Wi-Fi </ ion-toggle >
2828 </ div >
2929
3030 < script >
31- const form = document . getElementById ( 'my-form' ) ;
32- const wifi = form . querySelector ( 'ion-toggle' ) ;
31+ const wifi = document . querySelector ( 'ion-toggle' ) ;
3332
34- form . addEventListener ( 'submit' , ( event ) => submit ( event ) ) ;
3533 wifi . addEventListener ( 'ionChange' , ( event ) => validateToggle ( event ) ) ;
3634
3735 const validateToggle = ( event ) => {
4543 wifi . classList . add ( 'ion-valid' ) ;
4644 }
4745 } ;
48-
49- const submit = ( event ) => {
50- event . preventDefault ( ) ;
51-
52- validateToggle ( { detail : { checked : wifi . checked } } ) ;
53- } ;
5446 </ script >
5547 </ body >
5648</ html >
You can’t perform that action at this time.
0 commit comments