Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: HTML question

  1. HTML question

    I want to set up something simple in HTML where a person is asked a question and is presented with 3 options as possible answers. They would have to click a radio button or something to select one of the answers. I need to know how to set it up so that the page would then either tell them if the choice was right or wrong, either when they first click the radio button or upon clicking a next button after making their choice. Can anyone help? Thx.

    Dolemite, the Bad-Ass King of all Pimps and Hustlers
    Gymkata: I mean look at da lil playah woblin his way into our hearts in the sig awwwwwww

  2. Think you'll need Javascript for that. Which I know none of but may be able to get the code for you, if someone else doesn't find it I'll track it down real quick.

  3. Thanks. I wasn't sure if I would need JavaScript or not. But if you could track that down that'd be nifty.

    Dolemite, the Bad-Ass King of all Pimps and Hustlers
    Gymkata: I mean look at da lil playah woblin his way into our hearts in the sig awwwwwww

  4. Here's a quick little test thing I did, when you click on the radio button a message box pops up displaying whatever is inside the ' '

    This is the most barebones way to just display a result when they click on something. If you need something more complicated let me know.


    < SCRIPT>
    <!--
    function formCheck() {
    alert('lol')
    }
    // -->
    </ script>

    <head>



    <form id="form1" name="form1" method="post" action="">
    <label>
    <input name="radiobutton" type="radio" onclick="formCheck()" onselect="formCheck()"value="radiobutton"/>
    </label>
    </form>
    Last edited by Thief Silver; 31 May 2007 at 02:02 PM.

  5. Looked into if statements in Java script:

    function formCheck() {
    if (document.form1.radButton.checked)
    {
    alert('true');
    } else{
    alert('lol');
    }
    }

    Would be another way to do it if you wanted to have them select then hit a button as well. Or if you wanted to do some more intricate stuff.

  6. Fucking sweet. Thanks, man, I appreciate it.

    *EDIT* Okay, I have the first script you posted working. Just one question- the radio button shows up with a white square background around it. How do you changes the color? I have the button on a blue background.

    Also, how do I set it up so that, if they click on the correct answer, I can make a "CORRECT" message appear, but if they click on the wrong answer, a "PLEASE TRY AGAIN" message appears? I'm not sure how to set that up.

    Also, if they choose the wrong answer, is there a way to erase the dot from that answer after they click okay on the "PLEASE TRY AGAIN" box without reloading the page?

    Thanks for all your help, dude.
    Last edited by Dolemite; 31 May 2007 at 03:52 PM.

    Dolemite, the Bad-Ass King of all Pimps and Hustlers
    Gymkata: I mean look at da lil playah woblin his way into our hearts in the sig awwwwwww

  7. No problem.

  8. Actually, I just figured out how to name the scripts so that I can have different answers based on which radio button is selected, so forget that one.

    But if you can look into the bg color and how to empty the dot from the incorrect answer that would be cool.

    *EDIT* I just figured out the bg color thing, too. Amazing what you can accomplish when you get off your lazy ass and look around.

    Can't find anything about removing the dot from the wrong answers, however...
    Last edited by Dolemite; 31 May 2007 at 04:12 PM.

    Dolemite, the Bad-Ass King of all Pimps and Hustlers
    Gymkata: I mean look at da lil playah woblin his way into our hearts in the sig awwwwwww

  9. Sorry dole had left work but

    document.form1.radButton.checked = False

    should do the trick.

  10. Thanks, nigga. You're a lifesaver.

    Not to sound like a 'tard, however, but I can't figure out where exactly to insert that line above. No where I stick it seems to work.

    Dolemite, the Bad-Ass King of all Pimps and Hustlers
    Gymkata: I mean look at da lil playah woblin his way into our hearts in the sig awwwwwww

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Games.com logo