Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Kent, Washington
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Radios & JavaScript...HELP!

    Will somebody please tell me what I'm doing wrong in the following script? I just can't figure it out!

    <HTML><HEAD>
    <SCRIPT>
    function Score() {
    var tot = 0;
    tot += (document.order.quest1.value);
    tot += (document.order.quest2.value);
    tot += (document.order.quest3.value);
    document.order.totscore.value = tot;
    }
    </SCRIPT></HEAD>
    <BODY BGCOLOR=#000000 TEXT=#FFFFFF>
    <FORM NAME="order">
    <TABLE CELLPADDING=3 CELLSPACING=2 BGCOLOR=#000000>
    <TR>
    <TD>Question #1<BR>
    <INPUT TYPE="Radio" NAME="quest1" VALUE="1">&nbsp;Answer 1<BR>
    <INPUT TYPE="Radio" NAME="quest1" VALUE="2">&nbsp;Answer 2<BR>
    <INPUT TYPE="Radio" NAME="quest1" VALUE="3">&nbsp;Answer 3
    </TD>
    <TD>Question #2<BR>
    <INPUT TYPE="Radio" NAME="quest2" VALUE="1">&nbsp;Answer 1<BR>
    <INPUT TYPE="Radio" NAME="quest2" VALUE="2">&nbsp;Answer 2<BR>
    <INPUT TYPE="Radio" NAME="quest2" VALUE="3">&nbsp;Answer 3
    </TD>
    <TD>Question #3<BR>
    <INPUT TYPE="Radio" NAME="quest3" VALUE="1">&nbsp;Answer 1<BR>
    <INPUT TYPE="Radio" NAME="quest3" VALUE="2">&nbsp;Answer 2<BR>
    <INPUT TYPE="Radio" NAME="quest3" VALUE="3">&nbsp;Answer 3
    </TD>
    </TR>
    <TR>
    <TD COLSPAN=3>
    <CENTER>
    <INPUT TYPE="Button" NAME="SubQuest" VALUE="What's Your Score?" OnClick="javascript:Score();">
    </CENTER>
    </TD>
    </TR>
    <TR>
    <TD COLSPAN=3>
    <CENTER><INPUT TYPE="Text" NAME="totscore"></CENTER>
    </TD>
    </TR>
    </TABLE></FORM>
    </BODY></HTML>
    ~ Gigadestroyer

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Round Rock, Texas
    Posts
    443
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I get "NaN" in the score box when I run your page.

    NaN = "Not a Number".

    Not sure exactly how to fix it - sorry
    Last edited by RadarBob; 07-26-2002 at 06:18 PM.

  • #3
    New to the CF scene
    Join Date
    Jul 2002
    Location
    Kent, Washington
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry

    Okay, I took off the quotes exactly like you said and it still gives me NaN (which BTW I do know what it means) and I don't get it. WTF? This is very manacing....
    ~ Gigadestroyer


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •