I’ve had a search through the forum/GitHub issues and it seems a few people have encountered the same issue, but on previous versions of Ionic or their solutions do not appear to work for me.
I am using ionic 2.1.0 - this appears to also affect all versions of ionic2.
I have a form similar to this:
<form (ngSubmit)="register()" #registerForm="ngForm"> <ion-item> <ion-input type="text" name="username" [(ngModel)]="registration.username" required></ion-input> </ion-item> .... more inputs .... <ion-item> <ion-checkbox name="grantPermission" [(ngmodel)]="registration.grantPermission" required></ion-checkbox> </ion-item> <button type="submit" ion-button round block [disabled]="!registerForm.form.valid">Create Account</button> </form>
What I’m encountering:
- Filling in all inputs, but leaving ‘grantPermission’ checkbox UNCHECKED causes the submit button to become active, as if the form has passed validation.
What I expect:
- The form to only become valid once the ‘required’ checkbox is checked.
Any help on this one would be appreciated, thank you!