Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP Drop down list, how can i add images?

Featured Replies

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>";

?>

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.

I think you are going to require some javascript client side to show the image of the styles that are selected.

  • Author

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.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.