PDA

View Full Version : Dynamically change row background color based on HEX,DEC Val in textfield



eawade
02-10-2009, 04:52 PM
Hey Guys,

I am frustrated with this matter and therefore need some help. I will try to keep this as simple as possible. I really need some help performing something that should be relatively simple in Javascript. I have a form which contains two text fields (e.g. TEXTFIELD1 and TEXTFIELD2). Each text field holds a HEX,DEC color value. ABOVE this form I have a table with TWO ROWS. ROW1 should correspond with TEXTFIELD1, so that when the VALUE in TEXTFEILD1 is change the background color of ROW1 will change to match the HEX,DEC VALUE entered in TEXTFIELD1. The same would happen with TEXTFIELD2 and ROW2. I also wanted to know if it would be possible to achieve this without clicking any button. Basically once the value is input in the field the background of the corresponding row changes.


------------------------------------------------------------------
| ROW1 |
------------------------------------------------------------------
| ROW2 |
------------------------------------------------------------------

TEXTFIELD1 <----HEXDEC VALUE GOES HERE to change color of ROW1---->
TEXTFIELD2 <----HEXDEC VALUE GOES HERE to change color of ROW2---->

I apologize if I have written too much guys. Any help would be greatly appreciated. You guys are the best. :)

Thanks,
E.A.