473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

changing background color of multiple select

I have two multiple select inputs. Initially the first contains a bunch of
items and the second is empty. Using a common method, I move items back and
forth by double clicking on them.

This portion works perfectly, but I would also like to change the background
color of the select element with the current focus.

I have defined the following classes:

..selected {
background: #C0FFFF
}
..deselected {
background: #FFFFFF
}
Using the following function below I am able to shift the background color
of rows containing content, but the color of the empty rows remain the
"selected" color. How can this effect be achieved for all rows, whether they
contain content or not?

Thanks!

-----------------------------------------------------------

function changeBackground(obj,theSelect) {
for (var i=1; i<obj.length; i++) {
obj[i].className = 'deselected';
}
obj[theSelect].className = 'selected';
}
May 3 '06 #1
2 1828
Bosconian wrote:
I have two multiple select inputs. Initially the first contains a bunch of
items and the second is empty. Using a common method, I move items back
and forth by double clicking on them.

This portion works perfectly, but I would also like to change the
background color of the select element with the current focus.

I have defined the following classes:

.selected {
background: #C0FFFF
}
.deselected {
background: #FFFFFF
}
Using the following function below I am able to shift the background color
of rows containing content, but the color of the empty rows remain the
"selected" color. How can this effect be achieved for all rows, whether
they contain content or not?

Thanks!

-----------------------------------------------------------

function changeBackground(obj,theSelect) {
for (var i=1; i<obj.length; i++) {
obj[i].className = 'deselected';
}
obj[theSelect].className = 'selected';
}


Hi Bosconian,

I think you misposted. :-)
This is comp.lang.php
I think you want a HTML or JS newsgroup.

Regards,
Erwin Moller
May 3 '06 #2
"Bosconian" <bo*******@planetx.com> wrote in message
news:gu********************@comcast.com...
I have two multiple select inputs. Initially the first contains a bunch of
items and the second is empty. Using a common method, I move items back and forth by double clicking on them.

This portion works perfectly, but I would also like to change the background color of the select element with the current focus.

I have defined the following classes:

.selected {
background: #C0FFFF
}
.deselected {
background: #FFFFFF
}
Using the following function below I am able to shift the background color
of rows containing content, but the color of the empty rows remain the
"selected" color. How can this effect be achieved for all rows, whether they contain content or not?

Thanks!

-----------------------------------------------------------

function changeBackground(obj,theSelect) {
for (var i=1; i<obj.length; i++) {
obj[i].className = 'deselected';
}
obj[theSelect].className = 'selected';
}


Disregard--wrong group. Doh!
May 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Holden Caulfield | last post by:
Hi there, for IE 5+ I need to be able to change certain TD tagsī background colors, and canīt figure out how to do it... For instance, in a table with 25 cells, somewhere between 5 or 10 will...
4
by: david.graham18 | last post by:
Hi I spotted some nice code to change the background colour of a web page to one of four different colours at random but I can't find it now! The method was to select a number at random from 1...
6
by: Stephen Cook | last post by:
Having worked through the problems around enabling the document function using an XmlUrlResolver I started work on building a useful class to hide the intricacies. Trying to generalise the process...
0
by: Tom | last post by:
Hi I have a ListBox control of my asp.net web page. I want to set the value of the style property of the ListItem to a specific background color. I have tried this but no success: //li is...
12
by: GaryDean | last post by:
In the original post I failed so indicate that I am using framework 1.1....... I need to be able to change the background color of a page from code. I found an answer to this question in...
7
by: Glenn Hanna | last post by:
Hi, Can someone tell me how to change the background color of a web page though C#? I've tried various things that I have found on the web written in VB but I haven't had much luck with them. ...
8
by: Bosconian | last post by:
I have two multiple select inputs. Initially the first contains a bunch of items and the second is empty. Using a common method, I move items back and forth by double clicking on them. This...
13
by: amykimber | last post by:
Hi all, I know I'm doign something really daft, but I can't get this to work... I have a form with a bunch of inputs called ship_owner - why the ? Because I'm submitting this page though php...
1
by: 32Alpha | last post by:
Hi, first post here. First off, this IS a homework assignment for an operating systems class, but the question isn't "how do i do the assignment" but "why is my particular implementation not...
5
by: jeddiki | last post by:
I want to change the default background color of my select box. Here is the problem: Link to form with color select Notice in the color selector, the background color that I have given it it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.