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.
posted by a womble is an active kind of sloth to Computers & Internet (6 answers total) 1 user marked this as a favorite
Do you really need this level of control over the code/form? Otherwise, you might want to check out one of many hosted form solutions out there, e.g. Wufoo, Google Docs, FormSite, JotForm, etc.
posted by Foci for Analysis at 6:16 PM on March 24, 2012

Check out jQuery UI for more "standardized" widgets and controls.
posted by Blazecock Pileon at 6:18 PM on March 24, 2012 [1 favorite]

Is this example of a CSS-only form any help?
posted by urbanwhaleshark at 6:23 PM on March 24, 2012

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

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

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

« Older Looking for a very liberal church   |   Help me fix my dildo. Newer »
This thread is closed to new comments.