xx_princess_xx Posted May 14, 2009 Share Posted May 14, 2009 I have the image url stored in my sql database, so far i got this but i think im missing a quote, or apostrope i want the images to be displayed in a drop down menu echo '<option value="<img height='80' width='120' src='".$row['photo']."'">'<img height='80' width='120' src='".$row['photo']."''</option>'; Quote Link to comment https://forums.phpfreaks.com/topic/158087-display-images-in-a-drop-down-list/ Share on other sites More sharing options...
JonnoTheDev Posted May 14, 2009 Share Posted May 14, 2009 You cannot do this as far as I am aware (and have also tested). This is invalid HTML. Select lists are for text. Quote Link to comment https://forums.phpfreaks.com/topic/158087-display-images-in-a-drop-down-list/#findComment-833919 Share on other sites More sharing options...
xx_princess_xx Posted May 14, 2009 Author Share Posted May 14, 2009 alright then thanks anyway, its just i need to search my database by photos, so the user can select the photo and then information can be displayed in the results, is there anyway of doing this? Quote Link to comment https://forums.phpfreaks.com/topic/158087-display-images-in-a-drop-down-list/#findComment-833930 Share on other sites More sharing options...
JonnoTheDev Posted May 14, 2009 Share Posted May 14, 2009 Use a radio button next to the image Quote Link to comment https://forums.phpfreaks.com/topic/158087-display-images-in-a-drop-down-list/#findComment-833941 Share on other sites More sharing options...
Dathremar Posted May 14, 2009 Share Posted May 14, 2009 I wanted to do this, after a lot of googling I found some examples how it is made. The thing is like OP said this is not doable in a normal drop down. You will have to use CSS and javascript. So You will put all the options and the images into divs and then make them look like drop down list with css. Then add javascript functions for the onClick method, mouseover etc. GL making that P.S. I did't make it My contractor gave me too little time to play around Quote Link to comment https://forums.phpfreaks.com/topic/158087-display-images-in-a-drop-down-list/#findComment-833978 Share on other sites More sharing options...
JonnoTheDev Posted May 14, 2009 Share Posted May 14, 2009 The thing is like OP said this is not doable in a normal drop down. You will have to use CSS and javascript. So You will put all the options and the images into divs and then make them look like drop down list with css. Then add javascript functions for the onClick method, mouseover etc. Overkill. All you need radio - image radio - image radio - image update button Quote Link to comment https://forums.phpfreaks.com/topic/158087-display-images-in-a-drop-down-list/#findComment-834002 Share on other sites More sharing options...
Dathremar Posted May 14, 2009 Share Posted May 14, 2009 True that it is a lot of work, but if you want a drop down with images that's the way to do it. Quote Link to comment https://forums.phpfreaks.com/topic/158087-display-images-in-a-drop-down-list/#findComment-834026 Share on other sites More sharing options...
Ken2k7 Posted May 14, 2009 Share Posted May 14, 2009 Radio or checkboxes would work. Quote Link to comment https://forums.phpfreaks.com/topic/158087-display-images-in-a-drop-down-list/#findComment-834396 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.