Simple JavaScript Question...

Discussion in 'Javascript' started by number1.email@gmail.com, Dec 15, 2005.

  1. Guest

    Hello, I have a simple Web Page Questionairre in which questions are
    read from a database, and the user can indicate the correct answer via
    either a radio input control or a dropdown list. The number of
    questions that is displayed on the screen can vary...depending on the
    number of questions that satisfy certain criteria. Does anyone have
    any sample code, or can show me how I can validate this Web Page in
    JavaScript so that the user is forced to "answer" every question on the
    form (whether it is a radio control or dropdown list). Thanks.
     
    , Dec 15, 2005
    #1
    1. Advertising

  2. Hal Rosser Guest

    <> wrote in message
    news:...
    > Hello, I have a simple Web Page Questionairre in which questions are
    > read from a database, and the user can indicate the correct answer via
    > either a radio input control or a dropdown list. The number of
    > questions that is displayed on the screen can vary...depending on the
    > number of questions that satisfy certain criteria. Does anyone have
    > any sample code, or can show me how I can validate this Web Page in
    > JavaScript so that the user is forced to "answer" every question on the
    > form (whether it is a radio control or dropdown list). Thanks.
    >


    Add a radio button to each question - selected - "Don't Know"
    Then it is selected on startup and the user must select a different radio
    button - or get it wrong.

    For a javascript quiz, one idea is to put each question in a separate form.
    The script to grade the quiz could iterate thru the forms array to check if
    the correct answer was selected.
    The set up some variables
    var a = 0;
    var b = 1;
    var c = 2;
    var d = 3;
    var e = 4;
    Then set up the 'right answer array key'
    var rightAns = new Array (a,c,d,b,a,b,a,c,a,d,b,a,);
    .....
    hth
     
    Hal Rosser, Dec 17, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    575
  2. Kevin Spencer

    Re: Simple Simple question!!!

    Kevin Spencer, Jun 25, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    678
    Kevin Spencer
    Jun 25, 2004
  3. Daniel Frey

    Simple Question - Simple Answer?

    Daniel Frey, Dec 28, 2004, in forum: XML
    Replies:
    4
    Views:
    855
    Daniel Frey
    Jan 12, 2005
  4. Oli

    simple simple question

    Oli, Jan 26, 2004, in forum: ASP General
    Replies:
    10
    Views:
    383
    Roland Hall
    Jan 26, 2004
  5. Peter Bailey

    simple, simple array question

    Peter Bailey, Apr 8, 2008, in forum: Ruby
    Replies:
    7
    Views:
    219
    Peter Bailey
    Apr 8, 2008
Loading...

Share This Page