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

N

newfie912

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
 
E

Evertjan.

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.
 
A

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top