Gurus,
I am a niewbie in php. I have to modify an already existing code.
To populate second drop down menu as per the selected value of first drop down menu. Values of First drop down menu is from a mysql database + php. Now I have to insert a sub category menu in javascript by passing the selected value of the first dropdown.
Pls help.
thanks
multiple drop down menus
Moderator: General Moderators
-
kalpesh.mahida
- Forum Commoner
- Posts: 36
- Joined: Wed Oct 06, 2010 7:09 am
Re: multiple drop down menus
Hi,
Take a look at Simple chained combobox jQuery plugin at http://www.codeassembly.com/Simple-chai ... or-jQuery/
Hope this will help you,
Kalpesh Mahida
Take a look at Simple chained combobox jQuery plugin at http://www.codeassembly.com/Simple-chai ... or-jQuery/
Hope this will help you,
Kalpesh Mahida
Re: multiple drop down menus
Please help me how to proceed after this code.
<td>
<select name="topicId">
<option value="" selected >Select One</option>
<?
$services= db_query('SELECT topic_id,topic FROM '.TOPIC_TABLE.' WHERE isactive=1 ORDER BY topic');
if($services && db_num_rows($services)) {
while (list($topicId,$topic) = db_fetch_row($services)){
$selected = ($info['topicId']==$topicId)?'selected':''; ?>
<option value="<?=$topicId?>"<?=$selected?>><?=$topic?></option>
<?
}
}else{?>
<option value="0" >General Inquiry</option>
<?}?>
</select>
<font class="error">* <?=$errors['topicId']?></font>
</td>
</tr>
After this as per the value selected in the above drop down menu, a javascript shld be written such a way that the next menu values depend on the first menu.
There are only 2 values in the first menu and hence with if condition it may be written in javascript.
Pls help how to proceed.
regds
<td>
<select name="topicId">
<option value="" selected >Select One</option>
<?
$services= db_query('SELECT topic_id,topic FROM '.TOPIC_TABLE.' WHERE isactive=1 ORDER BY topic');
if($services && db_num_rows($services)) {
while (list($topicId,$topic) = db_fetch_row($services)){
$selected = ($info['topicId']==$topicId)?'selected':''; ?>
<option value="<?=$topicId?>"<?=$selected?>><?=$topic?></option>
<?
}
}else{?>
<option value="0" >General Inquiry</option>
<?}?>
</select>
<font class="error">* <?=$errors['topicId']?></font>
</td>
</tr>
After this as per the value selected in the above drop down menu, a javascript shld be written such a way that the next menu values depend on the first menu.
There are only 2 values in the first menu and hence with if condition it may be written in javascript.
Pls help how to proceed.
regds