Hi I need some help to learn how to do my dynamic dropdown. Basically on my dropdown I have value Others and when the user select this I want to display another text box beside it. Below is my codes but it didn't work I wonder where it went wrong.
Dropdown Menu:
Dropdown Menu:
Code:
echo "
<tr><td width='100%'><b>Generated By:</b></td>";
$res=mysql_query("select Generated_By from tblGeneratedBy");
if(mysql_num_rows($res)==0){
echo "there is no data in table..";
} else {
echo '
<td width="100%"><select name="GeneratedBy" id="GeneratedBy" value=\"$GeneratedBy\">';
for($i=0;$i<mysql_num_rows($res);$i++) {
$row=mysql_fetch_assoc($res);
echo"<option value=\"$row[Generated_By]\" ";
if($GeneratedBy==$row[Generated_By])
echo "selected";
echo ">$row[Generated_By]</option>";
}
if $row[Generated_By]== ('Others') {
echo "<input type='text' >"; else
}echo
"</select><br></tr></td>";
}
Comment