BKStart a conversation ↗

Knockout.js accept terms and conditions checkbox and submit button

Here’s a nice way of enabling a button on a form IFF the Accept T&C checkbox has been clicked.

Knockout script

So we have a simple acceptTerms variable that is observable.

Markup

In the markup above you can see that the input of id “agree” has bound its checked state to the observable, we also see that the submit button has bound its enable state.

Pretty simple client side solution if you’re already using knockout in your application.