You are here: Select box help « PHP Programming Language « IT news, forums, messages
Select box help

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация