Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript: Background color 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I want to change the background color in a listbox and a textbox. Here's my code:<br><br>function locChange()<br>{ var l = parent.body_frame.schedule.location_id<br> var nl = parent.body_frame.schedule.new_loc<br> if(l.value == 'new')<br> { l.bgColor = 'ffffff';<br> nl.bgColor = 'ffff00';<br> nl.disabled = false;<br> }else<br> { l.bgcolor = 'ffff00';<br> nl.bgColor = 'ffffff';<br> nl.disabled = true;<br> }<br>}<br><br>For some reason it isn't working. The disable assignments are working, but not the bgcolor assignments. Is there another property that needs to be set? Thanks in advance.
 
djcid,<br><br>try:<br><br>nl.style.backgroundColor = &quot;#ffff00&quot;;<br><br>That should work in IE don't know about &quot;the other&quot; browser.<br><br>Good luck<br>-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top