PHP + HTML + Javascript help needed!?

  • Thread starter Thread starter evachick156
  • Start date Start date
E

evachick156

Guest
I have a loop for the following code:

About 8 of these...
echo "<input type=checkbox name=\"" . $rows['id'] . "_quest8\" id=\"quest8\" onchange=\"getMethod()\" value=\"1\">";

and this...
<select name="solution" id="solution">
<?
echo("<option value='" . $rows['id'] . "' id='" . $rows['id'] . "'></option>");
?>
</select>

And here is my javascript:
function getMethod()
{
var select = document.getElementById("solution");
select.options[0] = new Option('Text 1', 'Value1');
}

So there are four rows of the checkboxes and the select box. When i
check a checkbox in the first row, i get "Text1" appears in the select box. However the second and the rest of the rows of checkboxes and the select box does not show up with any "Text1" Why isnt the other select boxes showing anything?
 
Back
Top