General Question

Its_Johnny's avatar

Help making a questionaire with javascript/html?

Asked by Its_Johnny (21points) June 10th, 2015

I want to make a questionaire and have a, b,c,d or yes/no answers. And if you click on C or click yes it will show a follow-up question you predefined. For ex, the question will read “do you like pizza?” If you click yes it will automatically show a following question such as “what topping do you like on your pizza?” My question is how do you make the follow-up question show up when you select a certain answer?

Observing members: 0 Composing members: 0

10 Answers

Blondesjon's avatar

Are you familiar with Javascript? Are you using any type of framework like jquery?

Its_Johnny's avatar

I dont know anything about jquery. I am familiar with javascript.

Vincentt's avatar

Then you might want to check out jQuery :) Also, are you sure you want to create it yourself and not use something like Google Forms or Survey Monkey? :)

Blondesjon's avatar

What @Vincentt said about jQuery. If you’re already familiar with javascript you will wonder how you ever lived without JQuery.

Their site has an extensive catalog of free code and demos. Their drop down section covers what you need and then some plus they give you very helpful guidelines on how to use it with your code.

Lawn's avatar

Here is a basic example to get you started. This uses jQuery. Please let me know if you have any questions.

http://jsfiddle.net/c9pynuqk/1/

Its_Johnny's avatar

@Lawn thank you for that. That is what im looking for. Is there a way i can see the results from the form submission?

Lawn's avatar

Just to clarify, do you want to simply display the results that the current user entered so they can review their individual answer OR do you want to store all results from several different users and display the totals?

Its_Johnny's avatar

I want to see the answers the users choose

Lawn's avatar

Then you will need a way to save that information to the server. Do you understand the difference between client and server? Client-side code usually includes HTML, JavaScript and CSS.

Server-side might include: PHP, ASP, JavaScript, Ruby, Python, etc.

Do you have a web host? You will need to determine what languages they support. PHP is the most common. If that’s the case, then you could use PHP to save the results to a JSON file or to a MySQL database. Are you familiar with either of those?

A newer option is MeteorJS. Meteor uses JavaScript on both the client and the server.

Its_Johnny's avatar

using the site @Lawn used, how do i add more questions?

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther