I'm developing a website and I've been looking for a plugin which allows me to use three state checkboxes.
Unfortunatly, all the stuff I've found (like here : http://extremefe.github.io/bootstrap-checkbox/) has their "indeterminate" state as a full square or as a dash. I need it to be a question mark ?
Do anyone has a solution to this ?
You cannot have
?
as an alias tonull
.In simple words, this plugin uses three keywords to determine the three states of the checkbox, namely:
true
false
null
All these do not equate to
undefined
, which is technically notnull
in JavaScript and can be used forboolean
operations. To use this plugin, you just need to include the jQuery Plugin:To use the three state checkbox, you just need to create a checkbox first:
And then make it a three state one:
To get the values from it:
You can have the full code here:
And to change the icon from
icon-stop
toicon-question
, please edit the source file,bootstrap-checkbox.js
on line number37
:And change it to:
Hope this helps!
Fiddle:
Check out the above working demo!