473,471 Members | 1,981 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Coloring check box list controls Client side

ASP.NET: I want to control the color of the text for a check box control in
JavaScript on the client.

I am able to do this by surrounding the check box in a SPAN tag. I then
color the span and the text changes. (as:
document.all.spanname.style.color=color)

The problem is that I want to do this with the individual controls in a
check box list. If I add a span around the check box list control, it's
around all the check boxes in the list, not each check box individually.
So, how do I color the text individually for each check box in the list?

Things that my work if I can get some help doing these:

1) I could create my own CheckBox control derived from the system control.
Then in the Render method, I could write the span tag around the control.
This work wonderfully for individual controls but how do I get the
CheckBoxList control to create these controls instead of the system ones?

2) I could create my own CheckBoxList control derived from the system
control. And have it write the span tags. Or have it create the derived
CheckBox controls. But these solutions means re-writing some CheckBoxList
control's functions (not just augmenting them). That would not be forward
compatible. I could wait until after the check boxes are created and then
get a list of them and up-class them to my derived control (that is, replace
the list with a different list). Not sure if this would work since I don't
now the internals of the CheckBoxList.

Anyone have an idea?

Thanks,
H. Scott Buckwalter

Nov 17 '05 #1
0 1690

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

Similar topics

3
by: Jim Mitchell | last post by:
My Goal is to have a dropdown (DL2) filled from the selectIndexChange event of a primary dropdown (DL1). These are picklists that will be selected frequently. Can someone recommend a strategy...
1
by: Ken Fine | last post by:
I need a client-side check against a static list of "banned words" before a form is submitted. Can someone point me to a script that does this?
6
by: Stu Carter | last post by:
Hi, I have an aspx page where some controls are initially disabled by the code-behind 'Page_Load' event. I want these controls to be dynamically enabled when the user checks a checkbox. ...
2
by: Bhupesh Naik | last post by:
This is a query regarding my problem to make a spell and grammar check possible in text area of a web page. We have aspx pages which are used to construct letters. The browser based screens...
0
by: H. Scott Buckwalter | last post by:
ASP.NET: I want to control the color of the text for a check box control in JavaScript on the client. I am able to do this by surrounding the check box in a SPAN tag. I then color the span and...
5
by: Mong | last post by:
Hi, I have a webform with various asp controls on it such as textboxes and dropdownlists. I'm fairly new to asp.net coming from VB6 and am wondering when it's best to use client side events and...
9
by: PawelR | last post by:
Hello group, I'm begginer in ASP.net and my question is very simple. In my webform I have CheckBox (myCB) and DropDownList (myDDL). I want set myDDL.Enabled =myCB.Checked and show change without...
22
by: Mr Newbie | last post by:
I was thinking about developing a workflow application yesterday and was musing over the different approaches than one could take in restricting specific actions on a ticket( Form ) at any said...
10
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked....
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.