ballisticnylon Posted November 7, 2004 Posted November 7, 2004 I'm trying to write a simple color-picker that will run in a browser. So far I've got a dropDownList populated with the names of known colors. I'd like to have each ListItem also have a small box filled with the appropriate color. I know how to do this in a Windows Forms environment, but I'm at a loss as to how to accomplish the same thing in ASP.NET. Has anyone out there ever done anything similar to this? Quote "It may be roundly asserted that human ingenuity cannot concoct a cipher which human ingenuity cannot resolve." - Edgar Allan Poe, 1841 I long to accomplish great and noble tasks, but it is my chief duty to accomplish humble tasks as though they were great and noble. The world is moved along, not only by the mighty shoves of its heroes, but also by the aggregate of the tiny pushes of each honest worker. - Helen Keller
*Gurus* Derek Stone Posted November 7, 2004 *Gurus* Posted November 7, 2004 While you can't add child elements to option elements, you can set their style properties. <select> <option value="FF0000" style="background-color: #FF0000;">Red</option> <option value="FFFF00" style="background-color: #FFFF00;">Yellow</option> <option value="FF00FF" style="background-color: #FF00FF;">Purple</option> <option value="00FF00" style="background-color: #00FF00;">Green</option> <option value="0000FF" style="background-color: #0000FF;">Blue</option> </select> Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.