Welcome Guest [Log In] [Register]
Viewing Single Post From: Add Colors
Arrogant
Member Avatar
Vote Choco and Nicola!
[ *  *  * ]
actually, you can use either. of course, if you use #111111, it will show up as #111111 in the dropdown - as well as in the UBBC that's placed in the textarea.

here's a different version that lets you have a different text than the value.

Code:
 
<script type="text/javascript"> <!--
var colors = [["Displayed in Dropdown", "Displayed in UBBC"], ["Ditto", "Ditto 2"]];
if(document.posting && document.posting.fcolor) $("select[@name=fcolor]").each(function() {
for(var j = 0, f = this.options.length; j < colors.length; j++) this.options[f + j] = new Option(colors[j][0], colors[j][1]);
for(var i = 1; i < this.options.length; i ++) this.options[i].style.color = this.options[i].value;
});
// --> </script>


so, if i had it like this: ["Red", "#123456"];
the dropdown list would say Red, but the tag would be [ color=#123456 ] - get it?
Edited by Arrogant, Feb 9 2008, 09:51 PM.
Offline Profile Quote Post
Add Colors · User Created Codes