Reputation: 11
How to validate checkbox which has value "I agree to the terms and conditions" in the sign-up page using bootstrapvalidator plugin.If the checkbox is not checked appropriate message should be displayed.
Upvotes: 1
Views: 2403
Reputation: 474
You can do that easily with jquery. (Wich you should have included if using Bootstrap).
if($("#checkbox").is(':checked')) {
alert("Welcome");
} else {
alert("You must agree to the ToS");
}
Here's more on that: http://api.jquery.com/checked-selector/
Upvotes: 1
Reputation: 1084
Refer this link Bootstrap Validation and Fire validation on submit button.
Upvotes: 0