I've something like this that's working.

Code JavaScript:

On click, this sends a value to a text field named rgb. The value is that of a color, like #FF0000

What I want, along with sending the color name, it also changes the background color of the text field. Like if it sends the value #FF0000 to my text field, the background color of the text field becomes #FF0000 (other thigns remain same, like it will still send the value #FF0000 as text to the text field).

I tried this =>

Code JavaScript:
onclick="showColorPicker(this,document.forms[0].rgb); document.forms[0].rgb.style.background='document.forms[0].rgb.value'"

but this is not working.

FF gives no error message whereas IE tells "Argument non valid"

Any help here? Thanks.