Solved

General design idea for survey entry screen

Posted on 2004-03-29
4
184 Views
Last Modified: 2006-11-17
We have an online survey that consists of several categories and with radio buttons for each category

Eg:

Main Category 1
   Option 1            R   R   R  R
   Option 2            R   R   R  R
   Option 3            R   R   R  R
Main Category 2
   Option 1            R   R   R  R
   Option 2            R   R   R  R
   Option 3            R   R   R  R

and so on where R is a radio button.

The categories, options and responses are stored in a database and retrieved/saved as needed.  Currently my php page loops through all the rows from the database and does an echo to build the form elements. This is all working fine, but is there a better way to do it? I need to save the responses and allow for modification too.

Any ideas on preferred approaches are appreciated.
Thanks!
0
Comment
Question by:svid
  • 2
4 Comments
 
LVL 4

Expert Comment

by:duerra
ID: 10705637
It seems like a good setup to me.  Provided that it's logical, and that you know what you're expecting in the event that you want to add more options later on, dynamically, I tend to think your setup should work well.
0
 
LVL 5

Author Comment

by:svid
ID: 10705720
Thank you.

To be a little more specific I would like to know is using a series of echo statements to build the tr /td/ <input type="radio" tags a good way to do things? One approach I was looking at was to create the xml in place of echo's and have a stylesheet attached to it to display the output. Another approach was using templates like Smarty (I don't know if it makes sense in this case)  - but I am new to PHP and its all a little overwhelming.

So any help would be great.

0
 
LVL 11

Assisted Solution

by:Paul S
Paul S earned 40 total points
ID: 10707444
if the survey is always the same (static) then you can build it in xml or css or whatever you want, but for retrieving the data enterned i would use php it is the easiest. if the survey is not static then php combined with css/xml would probably be the best.
0
 
LVL 4

Accepted Solution

by:
duerra earned 35 total points
ID: 10707741
If you're new to PHP, a templating engine would probably be a little deep to get into.  It would be pretty easy to simply loop over the values that you want to put in, if you embed some PHP into your HTML page, however.  I don't know exactly how you're doing it right now, so it's difficult to come up with a specific example, but do whatever queries you need to, and then loop through an echo statement that prints out a <input type="blah" value="more blah">, or something along that line.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question