Change Color of Background When USer Answers a Question Of True or False

Discussion in 'JavaScript' started by Steverz, Aug 9, 2007.

  1. #1
    I have an HTML page I am creating. It will contain a large list of questions to be answered. For here though, I will shorten it for simplicity.

    The HTML page for this example will have two columns and ten rows. If the User answers the question correctly, then the background color in the answer cell (the rows in the first column) will change to Green. If the answer is wrong, then the background will change to Red.

    In this example let's say that we have 10 questions to answer T or F (ture or false). Answers for questions 1,2,5 and 9 are to be false and the others true. How would that be coded? So, if a User answers questions 1,2 correctly then the backgound in the answer cell of the table will change to green while the background for the incorrectly answered question of 5 and 9 would be red. Hope this is clear.

    Here are a few examples:
    Question 1 is to be True and the User types in T. The background color behind the T now changes to Green.

    Question 2 is to be True and the User types in a F. The background color behind the F is to change to Red.

    Question 3 is to be False and the User types in a F. The background color behind the F is to change to Green.

    Question 4 is to be False and the User types in a T. The beckground color behind the T changes to Red.

    As you can see, if the User types in the correct answer, the background color changes to Green. If they type in an incorrect answer, the background color changes to Red.

    I do not know alot about Javascript so alot of help on this code is greatly appreciated.
     
    Steverz, Aug 9, 2007 IP
  2. Mike H.

    Mike H. Peon

    Messages:
    219
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think you are asking for far too much from a forum.

    If you cannot or will not post your HTML, the two columns and ten rows, with the radio buttons, (it's silly to have the user TYPE T or F) then what are you expecting from someone here? What?

    A forum is a place to get help, not free coding services.

    Create ALL the HTML, post it here or on another forum, and you'll likely get some HELP.

    But, you came here with nothing, nothing, not one line of code. It's your project. It's your responsibility.
     
    Mike H., Aug 9, 2007 IP
  3. Steverz

    Steverz Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Mike H: This request is NOT for a business or service and NO money is being made. Next, there are NO radio buttons on the form. As I mentioned earlier, there are 2 columns and 10 rows. In the first column a person will either place a T or F. If they have answered the question correctly, then the background will turn green. If incorrectly then the background will turn red. That is all it is.

    Hopefully some understanding folk will help. Thanks.
     
    Steverz, Aug 9, 2007 IP