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

toggle color depending on whether a radio button is selected or deselected

I have an online application used for grading students. On one of the
pages, I have a table with two rows and each row has 16 cells. The
upper row contains the letter grade (A, A-, B+, B, etc) and the lower
row has a 16 radio buttons for selecting the appropriate grade. This
all writes to a SQL server back-end and has been working fine for
several semesters. Some faculty members have complained that it is
hard to read and see which have been graded so far and which still
need to be graded. It has been suggested that we change the
background color of the selected letter grade to a different color. I
have had some sucess with this, but haven't figured out how to
"toggle" the color on and off based on the state of the radio button.
I can get it to change color when selected, but the color persists if
another radio button is selected. Does anyone have some sample code
for this?

thanks,

don

Feb 15 '07 #1
2 2593
newfie912 wrote on 15 feb 2007 in comp.lang.javascript:
I have an online application used for grading students. On one of the
pages, I have a table with two rows and each row has 16 cells. The
upper row contains the letter grade (A, A-, B+, B, etc) and the lower
row has a 16 radio buttons for selecting the appropriate grade. This
all writes to a SQL server back-end and has been working fine for
several semesters. Some faculty members have complained that it is
hard to read and see which have been graded so far and which still
need to be graded. It has been suggested that we change the
background color of the selected letter grade to a different color. I
have had some sucess with this, but haven't figured out how to
"toggle" the color on and off based on the state of the radio button.
I can get it to change color when selected, but the color persists if
another radio button is selected. Does anyone have some sample code
for this?
No, we don't yust supply sample codes, because we are not going to do your
work and we [at least I] think that helping should also be educational.

Try to give all radio buttns an onclick calling the same function each with
the argument "this".

The function clears the colour of all buttons, and then the colour of the
active button, that is the one that is clicked is set all using
style.backgroundColor.

Try to make a script and come back with your problems showing the script.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 15 '07 #2
ASM
newfie912 a écrit :
I have an online application used for grading students. On one of the
pages, I have a table with two rows and each row has 16 cells. The
upper row contains the letter grade (A, A-, B+, B, etc) and the lower
row has a 16 radio buttons for selecting the appropriate grade. This
all writes to a SQL server back-end and has been working fine for
several semesters.
You should have to use the evalutaion system based on points "Lomer"
....
only 4 grades
(something is known or not, what does mean a 1/16 of knowing ?)
Some faculty members have complained that it is
hard to read and see which have been graded so far and which still
need to be graded.
Pay them glasses ...

Sort the table.
(on each click on the page a function sorts the table with not graded
students in first, if all of them are graded an alert is displayed)
It has been suggested that we change the
background color of the selected letter grade to a different color. I
have had some sucess with this, but haven't figured out how to
"toggle" the color on and off based on the state of the radio button.
You only need to give a background color to the student's row, when a
radio of this row is chosen (that's to say when this row is clicked).
Some browsers doesn't accept to colorize radio (nor any other button).
I can get it to change color when selected,
checked !
but the color persists if
another radio button is selected. Does anyone have some sample code
for this?
A simple onclick in each tag TR of students
that changes or gives a class (css) to this element.
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Feb 15 '07 #3

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

Similar topics

1
by: bdawg | last post by:
what i want to do is create several radio buttons and a textbox for searching purposes. the search will perform a search depending on which button the user selects. here is what i have now: ...
0
by: Jane | last post by:
Hello I am developing a windows application, which uses a group of radio buttons and other components. After data is loaded from database, a user can select another radio button which has larger...
4
by: Neil Coleclough | last post by:
I am constructing a database to process product returns for my Company. I have a number of toggle buttons to identify the stage to which each return has been processed. For example, clicking the...
2
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...
3
by: Harry Haller | last post by:
I have a radio button group. When the page loads none of them are selected. OnClick selects ONE and clicking another one selects a different one - this is normal behavior. I want to modify it so...
2
by: lakepeir | last post by:
Hello, I have 4 radio buttons in a groupbox on a form. When I run the application, I would like to only select one radio button, but I can select one radio button from the first three radion...
4
by: Z.K. | last post by:
I started a forms application and I put on the form three buttons. In the functions for the radio buttons I put in a single messagebox like: MessageBox("Hello 1") MessageBox("Hello 2") ...
4
by: liltwese | last post by:
Hi, i'm new to VB. I have a problem with de-selecting radio buttons in group box containers. I've tried to set focus to other objects under Sub New (initialization) but it didn't work. The rdo...
7
by: moksha | last post by:
Hi, I am new to javascript and i am facing a problem in coding. plz help me out. I am using javascript for dynamically creating a table row which contains text boxes and radio...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.