Is there a way for me to select a radio button and change the contents of a list box?
I currently generate my list box with some php, but I would like to dynamically rebuild the list based on the selection of a radio button without refreshing.
I was thinking of loading an array for each object selected (Acute or CCC) into some javascript then building the list from the javascript. Is this how it would be done?
How do you pass an array in php to javascript?
Here is my current list box:
<?
for ($i=0; $i<$num_results; $i++) {
$row = mysql_fetch_object($result);
echo "<option value=" . $row->id . ">" . $row->fire_loc/option>\n";
}
?>
Any help is greatly appreciated!
John
I currently generate my list box with some php, but I would like to dynamically rebuild the list based on the selection of a radio button without refreshing.
I was thinking of loading an array for each object selected (Acute or CCC) into some javascript then building the list from the javascript. Is this how it would be done?
How do you pass an array in php to javascript?
Here is my current list box:
<?
for ($i=0; $i<$num_results; $i++) {
$row = mysql_fetch_object($result);
echo "<option value=" . $row->id . ">" . $row->fire_loc/option>\n";
}
?>
Any help is greatly appreciated!
John