473,396 Members | 1,996 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,396 software developers and data experts.

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 1686

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
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...

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.