Can anyone help, I would like the drop down list to display an image next to it when you select one of the selections, I also need it to display a short caption under the list so that it gives a brief description, can anyone help me with this as i've searched the web and it's not coming back with anything, here's the code i have so far to show you what i already have
<?php
require ("connect.php") ;
//extract data
$extract = mysql_query("SELECT * FROM image_styles ORDER BY id ASC") or die(mysql_error());
$numrows = mysql_num_rows($extract);
echo "<select name='styles'>";
while ($row = mysql_fetch_assoc($extract))
{
$id = $row['id'];
$styles = $row['styles'];
echo "
<option name='$id'>$styles </option>
";
}
echo "</select>";
?>
Page 1 of 1
PHP Drop down list, how can i add images?
#2
Posted 12 March 2010 - 07:26 AM
Hi,
Unfortunately some browsers like IE do not show images in drop-down lists. I think you can see them in Firefox, but if you want to display important information, I would advise not to rely on the image in the drop-down list.
Unfortunately some browsers like IE do not show images in drop-down lists. I think you can see them in Firefox, but if you want to display important information, I would advise not to rely on the image in the drop-down list.
#3
Posted 12 March 2010 - 07:36 AM
I think you are going to require some javascript client side to show the image of the styles that are selected.
#4
Posted 12 March 2010 - 09:19 AM
TopShopper, on 12 March 2010 - 07:36 AM, said:
I think you are going to require some javascript client side to show the image of the styles that are selected.
ok, perhaps i should go back to the way i had it before and call upon the php as an action, this way i had it working correctly.
Can anyone point in the right direction for this now? Let's say i select one option from a drop down list, i then submit it, that stores in my database and i then go onto the next page, i then have another drop down box. How do i get it to only display the options depending on what was selected in the 1st drop down box?
Thanks in advanced.
Share this topic:
Page 1 of 1
Help
















