Pages tagged checkbox

How to create checkbox in Bootstrap style ?

Here is the code to create a simple checkbox with bootstrap style:

Custom styled checkboxes with Bootstrap

Sometimes, you may want to add a little more customization to your checkboxes than available in the default bootstrap style. Here is a collection of custom checkbox styles for your bootstrap projects:

Checkbox validation using jQuery

Suppose you have a check box with ID agree_checkbox. You can check whether the checkbox is checked using this jQuery code:
$('#agree_checkbox').prop('checked')

Checkbox checked validation using JavaScript

You can check whether a checkbox is checked or not using checkbox_elemnt.checked attribute.

How to get checkbox value in form submission

Suppose you have a checkbox in your HTML form like this:

HTML Form Checkbox with required validation

The code below shows how to create a single checkbox with "required" validation. Make sure you have not selected the checkbox and then press the submit button to see the error message.

How to do multiple checkbox validation in Javascript

Checkboxes can be used as a single checkbox (like an on-ff switch) or as a group of checkboxes where the user can select one or more options.

How do we do validations when you have multiple checkboxes? Here are some samples.