![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
org.webjars.bower:bootstrap-checkbox-x
Advanced tools
An extended checkbox plugin for Bootstrap built using JQuery, which allows three checkbox states and includes additional styles. The plugin uses Bootstrap markup and CSS 3 styling by default, but it can be overridden with any other CSS markup. It also helps you to fallback to a native checkbox OR display native checkboxes with tristate capability.
With v1.5.5, the plugin now supports initializing widget on a SELECT input as well (other than a CHECKBOX or TEXT input).
NOTE: The checkbox plugin stores the values by default as character format (and not boolean format) for checked and unchecked states. This can be overridden by setting
valueChecked
,valueUnchecked
andvalueNull
properties.
data-toggle=checkbox-x
to an extended checkbox control.'1'
: Checkbox is checked. This value is configurable through valueChecked
property.'0'
: Checkbox is unchecked. This value is configurable through valueUnchecked
property.''
: Checkbox is indeterminate. This value is configurable through valueNull
property.has-error
, has-success
, has-warning
styling states like other Bootstrap form-controls.label
before or after with a for
attribute and click on the label to change the checkbox values. Alternatively you can enclose the
input within a label
tag as well.space
bar on the keyboard.xl
, lg
, md
, sm
, and xs
.change
event for the input, whenever the checkbox value is changed via clicking. Events currently available are change
and checkbox.reset
.NOTE: The latest version of the plugin v1.5.7 has been released. Refer the CHANGE LOG for details.
View the plugin documentation and plugin demos at Krajee JQuery plugins.
NOTE: You can use the sass branch for installation using bootstrap-sass dependency. The master branch can be used for installation using the default official bootstrap dependency.
You can use the bower
package manager to install. Run:
bower install bootstrap-checkbox-x
You can use the composer
package manager to install. Either run:
$ php composer.phar require kartik-v/bootstrap-checkbox-x "@dev"
or add:
"kartik-v/bootstrap-checkbox-x": "@dev"
to your composer.json file
You can also manually install the plugin easily to your project. Just download the source ZIP or TAR ball and extract the plugin assets (css and js folders) into your project.
Step 1: Load the following assets in your header.
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css">
<link href="https://cdn.jsdelivr.net/gh/kartik-v/bootstrap-checkbox-x@1.5.7/css/checkbox-x.min.css" media="all" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/kartik-v/bootstrap-checkbox-x@1.5.7/js/checkbox-x.min.js"></script>
<!-- optional if you are using themes -->
<link href="https://cdn.jsdelivr.net/gh/kartik-v/bootstrap-checkbox-x@1.5.7/css/theme-krajee-flatblue.min.css" media="all" rel="stylesheet" type="text/css" />
If you noticed, you need to load the jquery.min.js
and bootstrap.min.css
in addition to the checkbox-x.min.css
and checkbox-x.min.js
for
the plugin to work with default settings. Loading the theme file theme-krajee-flatblue.min.css
is optional and is needed if you want to override the default theme. Read the theme
property of the plugin for understanding configuration details for themes.
Step 2: Setup your input markup with data-toggle="checkbox-x"
to automatically initialize the checkbox control
<input type="checkbox" id="input-id" value="1" checked data-toggle="checkbox-x" data-three-state="true" data-size="lg" >
Step 3: You can also initialize the plugin on your page using javascript as well, instead of using data-toggle
attribute as above. For example,
<!-- enclose the checkbox input & label in container with class `cbx-krajee`
-- and also add the `cbx-label` class to your checkbox labels -->
<div class="cbx-krajee">
<input id="input-id" type="checkbox" value="1" checked>
<label for="input-id" class="cbx-label"></label>
</div>
<script>
$(document).on("ready", function() {
// initialize with defaults
$("#input-id").checkboxX();
// with plugin options
$("#input-id").checkboxX({threeState: true, size:'lg'});
});
</script>
The #input-id
is the identifier for the input on your page, which is hidden automatically by the plugin.
Alternatively, you can directly call the plugin options by setting data attributes to your input field.
Note: You should wrap the input and label in a container with CSS class
cbx-krajee
for better alignment. You should also add the CSS classcbx-label
to the labels for your checkbox inputs to style them similar to bootstrap's checkbox labels (which includes additional enhancements for contextual colors).
bootstrap-checkbox-x is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.
FAQs
WebJar for bootstrap-checkbox-x
We found that org.webjars.bower:bootstrap-checkbox-x demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.