Create a web-survey using javascript.
March 24, 2012 6:01 PM Subscribe
Advice on using Javascript and JQuery to create a web-survey.
I want to create a survey on a website that has 5 - 8 questions, and multiple-choice answers. At the moment I am planning to use Javascript and a bunch of forms and radio-buttons.
I have the overall structure working for a simple case (user ticks various radio buttons, clicks submit and the data + cookie info is loaded into a database using a JQuery post command). However, I don't have a good strategy for formatting the button positions and I'm not sure if there is a better way of organizing the radio-buttons. Also, some of the questions will have pictures above the radio-buttons. I am using CSS, but I'm finding the individual button text to be a little tricky to handle as it varies in length.
I would appreciate any pointers on how best to improve this. I feel like there might a library out there that already handles some of the browser side organization but I haven't been able to find it though googling.
I want to create a survey on a website that has 5 - 8 questions, and multiple-choice answers. At the moment I am planning to use Javascript and a bunch of forms and radio-buttons.
I have the overall structure working for a simple case (user ticks various radio buttons, clicks submit and the data + cookie info is loaded into a database using a JQuery post command). However, I don't have a good strategy for formatting the button positions and I'm not sure if there is a better way of organizing the radio-buttons. Also, some of the questions will have pictures above the radio-buttons. I am using CSS, but I'm finding the individual button text to be a little tricky to handle as it varies in length.
I would appreciate any pointers on how best to improve this. I feel like there might a library out there that already handles some of the browser side organization but I haven't been able to find it though googling.
Best answer: Check out jQuery UI for more "standardized" widgets and controls.
posted by Blazecock Pileon at 6:18 PM on March 24, 2012 [1 favorite]
posted by Blazecock Pileon at 6:18 PM on March 24, 2012 [1 favorite]
I recently used this xmlQuiz script (using PHP and XML) when I needed to create a quiz that would have photos (or videos) as part of the quiz questions. This script made it easy to control the formatting via CSS too. Since it requires PHP, you couldn't use this script to run the quiz offline (the way that, say, you potentially could with a Javascript-only script), but I don't know if that's important to you. Just FYI!
posted by lgandme0717 at 7:58 PM on March 24, 2012
posted by lgandme0717 at 7:58 PM on March 24, 2012
Without an example of the pictures, questions, and answers that you will provide, it is hard to determine what the best layout would be.
posted by jasondigitized at 8:48 PM on March 24, 2012
posted by jasondigitized at 8:48 PM on March 24, 2012
Response by poster: Thanks Blazecock Pileon, that was the encouragement I needed to try using jQuery UI. It's great!
posted by a womble is an active kind of sloth at 6:44 AM on March 25, 2012
posted by a womble is an active kind of sloth at 6:44 AM on March 25, 2012
This thread is closed to new comments.
posted by Foci for Analysis at 6:16 PM on March 24, 2012