Help with populating a questionnaire!

S

standon410

Hi,
I'm trying to develop a questionnaire...basically a user can pick one
of 5 questionnaires they want to use, and based on their choice, those
questions will appear in their form.

So the database table contains all the questions/radiobutton selections
in one table (well, a view), and they are related to their respective
questionnaires based on a form ID.

Now, How do I populate a RadiobuttonList, AND label above the
radiobuttonlist, so that the the label would hold the question, and the
radiobuttonlist would hold the selections for that question...and this
would be based on form, and based on question (ie, some questions only
have 3 choices, some have 2, etc). I guess I just need some help
starting off the code for both the design, and SQL. Would I use the
Repeater for this? I've never used this before, so I'm not sure how to
implement it. Anyway, if anyone has suggestions, please let me know!!
I need help! Thanks!

Here is some sample data of the table:

QID Question FID Radio_Caption Radio_Value
1 1) Please rate your knowledge FormA very little knowledge 1
1 1) Please rate your knowledge FormA little knowledge 2
1 1) Please rate your knowledge FormA some knowledge 3
2 2) Does anyone in your family FormA Yes 1
2 2) Does anyone in your family FormA No 2
3 3) Genes are made of FormA DNA 1
3 3) Genes are made of FormA RNA 2
3 3) Genes are made of FormA proteins 3
21 1) Have you ever had testing FormB Yes 1
21 1) Have you ever had testing FormB No 2
22 2) The religious affiliation FormB Buddhism 1
22 2) The religious affiliation FormB Catholic 2
22 2) The religious affiliation FormB Hinduism 3
 
C

clintonG

Start by using the web to search for tutorials that explain how to populate
a control with data. You can start with tutorials that discuss how to
populate DropDownList controls with data because those tutorials are easy to
find. They will help you get insight into how the database is accessed and
how the data is bound to a control's list items. It seems you will also need
to learn how to generate a control dynamically because you may never know
how many RadioButtons each question will need.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
 
S

standon410

I've looked some stuff up, and only found basic code which I've played
with. My problem is now combining the labels/radiobuttonlists into
specific questions by relating them to each other. I'd rather figure
this part out first, and then try to figure out how to dynamically
check for how many radiobuttons will be needed. Any ideas?
 
S

standon410

I guess I need to come up with the code for a loop, but i'm not sure of
the syntax....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top