I am having 2 problems with the following script, I have checked and rechecked and tried several solutions.. Can someone help set me straight on where I am going wrong..
Thanks in advanced...
$questions = array(
"Question 1",
"Question 2",
"Question 3",
"Question 4",
"Question 5"
);
$answers = array(
array ("Answer 1", "Answer 2", "Answer 3", "Answer 4"),
array ("Answer 1", "Answer 2", "Answer 3", "Answer 4"),
array ("Answer 1", "Answer 2", "Answer 3", "Answer 4"),
array ("Answer 1", "Answer 2", "Answer 3", "Answer 4"),
array ("Answer 1", "Answer 2", "Answer 3", "Answer 4")
);
Problem One:
Using the following arrays above I am trying to create a list of questions, and a select list of their answers, when I use the following
script below it only lists every other question and its corrisponding select box of anwsers.. can anyone help me on where I went wrong.
IE: Question 1, Question 3, Question 5 will only show...
<?php
for ($ndx = 0; $ndx < count ($questions); $ndx++) {
?>
<tr><td>
<?php
$display_answers = ArrayGen($answers[$ndx]);
echo FormHdr("$questions[$ndx]:"); "";
?>
</td><td>
<?php
FormSelect ("answers[$ndx]", $display_answers);
$ndx++;
?>
</td></tr>
<?php
}
?>
Problem Two
I am have trouble with adding at the top of the list, Please Select An Answer. When the select box has been built
I am looking to have it look like the following:
<option value="">Please Select An Answer</option>
<option value="Answer 1">Answer 1</option>
<option value="Answer 2">Answer 2</option>
<option value="Answer 3">Answer 3</option>
<option value="Answer 4">Answer 4</option>
<option value="Answer 5">Answer 5</option>