Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to add a color palette into a texbox using javascript?

i tried using below code,


jquery
<script type="text/javascript" src="js/colorpicker.js"></script>


$(document).ready(function(){
   $('#colorpickerField1').ColorPicker({
    onSubmit: function(hsb, hex, rgb, el) {
        $(el).val(hex);
        $(el).ColorPickerHide();
    },
    onBeforeShow: function () {
        $(this).ColorPickerSetColor(this.value);
    }
   })
    .bind('keyup', function(){
        $(this).ColorPickerSetColor(this.value);
      });
});


but getting error 'SpawColorPicker' in colorpicker.js is undefined.
how to solve thi?
Posted

1 solution

 
Share this answer
 
Comments
hasbina 7-Feb-13 1:42am    
hmm.i want a client side option
Avik Ghosh22 7-Feb-13 1:56am    
r u satisfied with this code????
hasbina 7-Feb-13 2:05am    
no
Avik Ghosh22 7-Feb-13 2:19am    
then try this...
http://jscolor.com/

i use this code many times ...

for source code
http://jscolor.com/download.php

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900