Is there a way to hide the textbox that is targeted by the colorpickerextender in the newest release of the ajax control toolkit?
If you add
style="display:none"to the textbox, then the color picker shows up in the top left corner of the browser window. I want it to show up near the button that is referenced in the extenders popupbuttonid.
I want to hide the textbox because I don't want the user to see the color code.
While I didn't hide it, I did find another way to get what I wanted. When the color is selected I call a javascript function that gets the color code from the textbox and stores it in a hidden field, then clears the textbox's text, then finally sets the background color of the textbox to the color that was selected.
Here is the aspx code:
And the code behind:
I just assign the code to the label to prove that color code is being submitted. Sorry for the aspx formatting. Tested and working in Chrome, IE 6, IE 7, Firefox 3, Opera 9, and Safari 4.
The previous code is a bit a mess. I changed it a bit to make it clearer.
and the html part
where txtMessage is the texbox they are going to write on (imagine a chat textbox). You can comment that line if you dont need it
Form the code behind just use ColorCode.value to retrive the color code selected.