Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > toggle color depending on whether a radio button is selected or deselected

Reply
Thread Tools

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

 
 
newfie912
Guest
Posts: n/a
 
      02-15-2007
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

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      02-15-2007
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)
 
Reply With Quote
 
 
 
 
ASM
Guest
Posts: n/a
 
      02-15-2007
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é
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selected toggle button background color Todd Java 3 08-30-2007 06:38 PM
wanna make object invisible/visible depending upon the click of radio button in asp 3.0 meet_ravipatel@yahoo.com Javascript 1 04-10-2007 05:04 PM
getParameterMap() and deselected checkboxes Ken Clark Java 1 09-22-2006 06:02 PM
"Connect when this network is in range" deselected by default =?Utf-8?B?dHJlYWw=?= Wireless Networking 0 07-14-2006 06:04 PM
Radio button List problem: How to find value of Radio button list's Selected Item using javascript?? Hiten ASP .Net Web Controls 1 05-26-2004 10:32 AM



Advertisments