|
Posted by Jon on 05/02/06 23:36
All,
I have a problem that I'm not quite sure what algorithm will help me on. I'm
bringing in records from MySQL using PHP and need to spit this records into
a select box. Fairly simple, here's my code for the first select box:
<option selected
value="<?=$currentCatID?>"><?=$currentCategoryName?><option>
<?php
while($rowGetCat = mysql_fetch_array($resultGetCat)){
if($rowGetCat['pCatID'] != $currentCatID){
echo "<option
value=\"".$rowGetCat['pCatID']."\">".$rowGetCat['pCatName']."</option>";
}
}
?>
</select>
Problem is - based on their choice with the first select box, I need to
query the DB and populate a second select box. So basically, I need a 2nd
select box that is populated on the fly based on their choice from the first
select box. The only solutions I have found so far use their own form, and
the form I have now has numerous other options and values that I need to
save the state of for editing.
I was thinking AJAX might help, or maybe just regular javascript, but
without having the entire page reload I'm not sure. Any ideas?
Navigation:
[Reply to this message]
|