Home All Groups Group Topic Archive Search About

Help with populating a questionnaire!

Author
8 Sep 2006 9:07 PM
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

Author
8 Sep 2006 11:25 PM
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


<standon***@gmail.com> wrote in message
Show quote
news:1157749666.287485.238670@i42g2000cwa.googlegroups.com...
> 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
>

AddThis Social Bookmark Button