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

Thread: Help with HTML/Java Script please...

  
  1. #1
    Status
    Offline
    S30TTV's Avatar
    AOC Fanatic
    Join Date
    Jul 2006
    Posts
    645
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)

    Help with HTML/Java Script please...

    Ok, i need to create a page that has three questions.

    the first question has 7 options (opt 1 =1, opt 2 =2, opt 3 4 5 6 7 =3)
    the second question has 3 options (opt 1 =1, opt 2 =2, opt 3 =3)
    & the third question has 3 options (opt 1 =1, opt 2 =2, opt 3 =3)

    Basically the questions need to be answered then a result will be displayed at the bottom of the page.

    i.e.
    Q1 opt 5 (value 3)
    Q2 opt 1 (value 1)
    Q3 opt 2 (value 2)

    total value=6, so the result (message) for the value 6 would be displayed.

    Thanks for any help with this.

    rough example...

    2L Coupé - Regal Phase 3 - FMIC - SportsCat - VXR Turbo - Lambo Doors - Powerflow Exhaust & Custom ICE : www.scottsmotor.co.uk

  2. #2
    Status
    Offline
    joemailey's Avatar
    AOC Obsessed
    Join Date
    Nov 2007
    Posts
    2,551
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    What your best of doing is searching Google for Quiz scripts as they will display answers.

    Or

    If your looking for survey for collecting information. your probably best of finding a site online to use that will let you implement the survey in your site..

    If you were using something along the lines or Joomla or Wordpress you could of easliy got a plugin to do the sort of thing you want.
    Quote Originally Posted by DaveDempsey View Post
    Hey atleast MOTing your car should be a lot simpler than MOTing your EX. Replacing a worn out bush on a car is far easier.



  3. #3
    Status
    Offline
    domino's Avatar
    User
    Join Date
    Aug 2006
    Posts
    6,269
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    Not entirely sure what you're asking here mate

    Can i break this down and tell me if i'm right?

    1) every question has multiple choices. Each answer has a value attached (numerical?). For example, question 1 has numerical values up to 3 (last 5 options equalling '3'), question 2 up to 3 and question 3 up to 3.

    2) Once all the questions have been answered, the result will equal the sum of all values from the questions. So, in your example, this will be '6'.

    3) You want the value '6' to correspond to text within an array or database or whatever and the data associated with value '6' is brought out and displayed in the results window?

  4. #4
    Status
    Offline
    TomR's Avatar
    AOC Regular
    Join Date
    Apr 2008
    Posts
    187
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    I have a PHP script I had made which allows you to stipulate questions and values via an admin panel and the results are output thru an Image ( For viral myspace stuff really) Or, text.

    If you know what you're doing with PHP I'm happy to send it over.

    Seems to match what you are after.

  5. #5
    Status
    Offline
    domino's Avatar
    User
    Join Date
    Aug 2006
    Posts
    6,269
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    Quote Originally Posted by TomR View Post
    I have a PHP script I had made which allows you to stipulate questions and values via an admin panel and the results are output thru an Image ( For viral myspace stuff really) Or, text.

    If you know what you're doing with PHP I'm happy to send it over.

    Seems to match what you are after.
    That's the angle I was going for.. and I've spent a while looking for the damn thing and can't find it now. Too much crap on my pc!

    Mind you, could be JS for a reason I spose..

  6. #6
    Status
    Offline
    Ian Griffiths's Avatar
    AOC Fanatic
    Join Date
    Jun 2003
    Posts
    812
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    Design the form in HTML and have a Javascript onclick on the radio button which increments a score variable and also three flag variables which you also check and when the logical and of all three is true - ie. all questions have been answered, the result is displayed.

    No real reason to go PHP with that except it's potentially a bit easier to program and your visitor won't get as much information about the outcome by viewing the source.

    If you want me to knock something up I'll spend some time on it.

  7. #7
    Status
    Offline
    S30TTV's Avatar
    AOC Fanatic
    Join Date
    Jul 2006
    Posts
    645
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    Spot on mate

    Quote Originally Posted by domino View Post
    Not entirely sure what you're asking here mate

    Can i break this down and tell me if i'm right?

    1) every question has multiple choices. Each answer has a value attached (numerical?). For example, question 1 has numerical values up to 3 (last 5 options equalling '3'), question 2 up to 3 and question 3 up to 3.

    2) Once all the questions have been answered, the result will equal the sum of all values from the questions. So, in your example, this will be '6'.

    3) You want the value '6' to correspond to text within an array or database or whatever and the data associated with value '6' is brought out and displayed in the results window?
    If you have it to hand il try it, thanks

    Quote Originally Posted by TomR View Post
    I have a PHP script I had made which allows you to stipulate questions and values via an admin panel and the results are output thru an Image ( For viral myspace stuff really) Or, text.

    If you know what you're doing with PHP I'm happy to send it over.

    Seems to match what you are after.
    I would appreciate that mate, thanks

    Quote Originally Posted by Ian Griffiths View Post
    Design the form in HTML and have a Javascript onclick on the radio button which increments a score variable and also three flag variables which you also check and when the logical and of all three is true - ie. all questions have been answered, the result is displayed.

    No real reason to go PHP with that except it's potentially a bit easier to program and your visitor won't get as much information about the outcome by viewing the source.

    If you want me to knock something up I'll spend some time on it.
    If any one has any script that i can use please send it to scottdeamer@hotmail.com or PM, thank you.
    2L Coupé - Regal Phase 3 - FMIC - SportsCat - VXR Turbo - Lambo Doors - Powerflow Exhaust & Custom ICE : www.scottsmotor.co.uk

  8. #8
    Status
    Offline
    S30TTV's Avatar
    AOC Fanatic
    Join Date
    Jul 2006
    Posts
    645
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    If it helps il show you what im after.

    Title "TEST"

    Question one.
    What was your reading?
    0-6
    7-10
    11-15
    16-20
    21-25
    26-30
    31 plus

    Question two.
    How many cigarettes do you smoke per day?
    9 or less
    10-20
    20 plus

    Question three.
    How long do you wait before your first cigarette of the day?
    30 minutes plus
    6-29 minutes
    upto 5 minutes

    (greens are valued as 1, ambers are valued as 2 & reds are valued as 3)


    Results. i dont want the number to be displayed only the message that corrasponds with the level. The message i can add.

    (3 or 4) LEVEL 1 "message"

    (5) LEVEL 2 "message"

    (6) LEVEL 3 "message"

    (7) LEVEL 4 "message"

    (8 or 9) LEVEL 5 "message"

    Id like the results to be displayed in the colours above or preferably the background of the results box to change to the above colours.

    Thank you for any help
    2L Coupé - Regal Phase 3 - FMIC - SportsCat - VXR Turbo - Lambo Doors - Powerflow Exhaust & Custom ICE : www.scottsmotor.co.uk

  9. #9
    Status
    Offline
    domino's Avatar
    User
    Join Date
    Aug 2006
    Posts
    6,269
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    Right.

    Let me try and find the code I have - it might take a while tho

    Could code something reaalllyyy rough for you in PHP, but i'd have to be in the right mindset lol.

  10. #10
    Status
    Offline
    Ian Griffiths's Avatar
    AOC Fanatic
    Join Date
    Jun 2003
    Posts
    812
    Mentioned in
    0 Post(s)
    Quoted
    0 Post(s)
    You don't need PHP, it can be checked without a page change.

    http://www.corsasport.co.uk/misc/form.htm

    View the source to save it. You'll also need to change the messages.

Page 1 of 2 12 LastLast

Similar Threads

  1. Whats the script with 20XEV engines.....?
    By MarkC in forum Astra Discussion & Chat
    Replies: 15
    Last Post: 23-06-2004, 12:05

Posting Permissions

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