Help with dynamic radio buttons

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Afternoon all

I need some help here with a problem on dynamic radio buttons.

I have a script that calls a database for a list of questions. The questions
are returned and each question needs to have 5
radio buttons assigned to it. The radio buttons are a score of 1 - 5 (1
being bad, 5 being good)

For example

1 . How would you rate your vacation?    1 2 3 4 5 <--- those are the radio
buttons.
2. How would you rate your dining at the resort? 1 2 3 4 5


Ok so I have all the questions being returned, I was thinking when creating
the radio buttons as follows

<input name="<?php echo $row_get_question_list['id']?>" type="radio"
value="1" />
<input name="<?php echo $row_get_question_list['id']?>" type="radio"
value="2" />
<input name="<?php echo $row_get_question_list['id']?>" type="radio"
value="3" />
<input name="<?php echo $row_get_question_list['id']?>" type="radio"
value="4" />
<input name="<?php echo $row_get_question_list['id']?>" type="radio"
value="5" />

The input name for each radio group is the questions id from the database.
If there are 50 questions you would have 50 radio button answers submitted.
How are you going to identify the radio buttons being submitted as they are
dynamic? and also I would need to be stored in the
session data as they might want to go back / forward a page.

So basically I need to go through each $_GET item, identify it as a radio
submission and put it into an array.

Has anyone done anything similar before / or can point me in the right
direction??

Kind regards
Chris



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux