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

Discussion in 'Javascript' started by newfie912, Feb 15, 2007.

  1. newfie912

    newfie912 Guest

    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
     
    newfie912, Feb 15, 2007
    #1
    1. Advertisements

  2. newfie912

    Evertjan. Guest

    newfie912 wrote on 15 feb 2007 in comp.lang.javascript:
    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., Feb 15, 2007
    #2
    1. Advertisements

  3. newfie912

    ASM Guest

    newfie912 a écrit :
    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 ?)
    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)
    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).
    checked !
    A simple onclick in each tag TR of students
    that changes or gives a class (css) to this element.
     
    ASM, Feb 15, 2007
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.