I have seen the other answers as well, I ain't looking forward to show or hide a submit button, rather want it to be enabled or disabled if the checkbox is checked or not, respectively. I am working with Angularjs 2 & so looking for an answer in the same... Here's the html code:
<input type="checkbox" id="checkbox2">
<span>I have carefully read the agreement <br/>& agree to all Terms & Conditions</span>
</center>
<button md-raised-button class="md-raised" type="submit" id="but5" [disabled]="![checked]" style="margin-left:34px;">NEXT</button>
@GünterZöchbauer's answer is almost correct. This is a solution you could use.
<input type="checkbox" #checkbox (change)="angular = checkbox.checked">
<button type="submit" [disabled]="!checkbox.checked ? true : null">
You could also use something like this:
<input type="checkbox" [(ngModel)]="object.selected" />
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments