Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Javascript (http://www.velocityreviews.com/forums/f68-javascript.html)
-   -   toggle color depending on whether a radio button is selected or deselected (http://www.velocityreviews.com/forums/t929781-toggle-color-depending-on-whether-a-radio-button-is-selected-or-deselected.html)

newfie912 02-15-2007 05:12 PM

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


Evertjan. 02-15-2007 05:21 PM

Re: toggle color depending on whether a radio button is selected or deselected
 
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)

ASM 02-15-2007 05:48 PM

Re: toggle color depending on whether a radio button is selectedor deselected
 
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é


All times are GMT. The time now is 10:18 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.