Solved

General design idea for survey entry screen

Posted on 2004-03-29
4
179 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now