Looking to add a color picker to a form? Check out the bootstrap-colorpicker. I've set up mine by adapting code from the advanced forms page on the Admin LTE 2 demo:
<!-- Color Picker -->
<div class="form-group">
<label>Color picker with addon:</label>
<div class="input-group colorpicker-critically">
<input type="text" class="form-control" />
<div class="input-group-addon">
<i></i>
</div>
</div>
<!-- /.input group -->
</div>
To initialize, simply use this plugin:
$(document).ready(function () {
//color picker with addon
$(".colorpicker-critically").colorpicker();
});
Remember to link the .js
before the .css
in your <head>
tag. And jQuery must be included too.
If you encounter errors while testing the page, check them out here: https://i.sstatic.net/O1Ooy.png
This is how my <head>
Tag looks like:
<!-- All necessary scripts and stylesheets -->
<script src="/plugins/colorpicker/bootstrap-colorpicker.min.js" type="text/javascript"></script>
<link href="/plugins/colorpicker/bootstrap-colorpicker.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/plugins/ionslider/ion.rangeSlider.min.js"></script>
<link href="/plugins/ionslider/ion.rangeSlider.css" rel="stylesheet" type="text/css" />
<link href="/plugins/ionslider/ion.rangeSlider.skinNice.css" rel="stylesheet" type="text/css" />
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" />
<link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />
<link href="../dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
<link href="../dist/css/skins/_all-skins.min.css" rel="stylesheet" type="text/css" />
<link href="../plugins/iCheck/flat/blue.css" rel="stylesheet" type="text/css" />
<link href="../plugins/morris/morris.css" rel="stylesheet" type="text/css" />
.lt;link href="../plugins/jvectormap/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
.lt;link href="../plugins/datepicker/datepicker3.css" rel="stylesheet" type="text/css" />
.lt;link href="../plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
.lt;link href="../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css" rel="stylesheet" type="text/css" />
<!-- IE8 support -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
Any assistance on this matter is greatly appreciated. Thanks!