Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

General design idea for survey entry screen

Posted on 2004-03-29
4
Medium Priority
?
192 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 120 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 105 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

783 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