Help - Search - Members - Calendar
Full Version: Image in a list box
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
robgratt
Hi,
I would like to display images in a list box. I have searched the web, but have not found any way of doing this. PHP, Javascript etc. would be fine. Anyone any ideas?
Frederiek
How about CSS?
Go see eg. at Listamatic.
Christian J
Or did you mean a SELECT menu? In that case a background image might be used for either the SELECT or OPTION element, but few browsers support it.
robgratt
QUOTE(Frederiek @ Apr 24 2007, 10:47 PM) *

How about CSS?
Go see eg. at Listamatic.


Thanks, Frederiek. I didn't make myself clear. I wanted to be able select from a drop down list where each item in the list has a different image. I have had a quick look at the Listomatic stuff, but they seem to use the same image for each item in the list. Will keep looking, though.

Rob
robgratt
QUOTE(Christian J @ Apr 25 2007, 02:21 AM) *

Or did you mean a SELECT menu? In that case a background image might be used for either the SELECT or OPTION element, but few browsers support it.


Christian J,

Yes, that's what I want. When you say 'few' which ones do you mean?

Thanks for the reply.

Rob
pandy
But what kind of drop down list do you want? Your only complaint about the Listamatic ones seems to be that they displayed the same image for all options. That can easily be changed. But if you want to use a form as Christian suggested it's a whole other matter.
Christian J
QUOTE(robgratt @ Apr 25 2007, 02:01 PM) *

When you say 'few' which ones do you mean?

Only Firefox on Windows. Havent' tested Safari/Mac. They should all support background-color, though.

OTOH, if you're using the SELECT element for site navigation you might consider a DHTML menu like http://alistapart.com/articles/dropdowns these can be styled much more.
robgratt
QUOTE(Christian J @ Apr 25 2007, 11:00 PM) *

QUOTE(robgratt @ Apr 25 2007, 02:01 PM) *

When you say 'few' which ones do you mean?

Only Firefox on Windows. Havent' tested Safari/Mac. They should all support background-color, though.

OTOH, if you're using the SELECT element for site navigation you might consider a DHTML menu like http://alistapart.com/articles/dropdowns these can be styled much more.


Christian J,

Thanks for bearing with me on this. Will try the SELECT/OPTION route. I want to allow customers to select from a graphic of a product and put the resultant value into a form.

Will check out the URL you sent.

Regards, Rob
Christian J
QUOTE(robgratt @ Apr 26 2007, 12:29 AM) *

I want to allow customers to select from a graphic of a product and put the resultant value into a form.

Why not use radio buttons next to images?
robgratt
QUOTE(Christian J @ Apr 26 2007, 08:54 AM) *

QUOTE(robgratt @ Apr 26 2007, 12:29 AM) *

I want to allow customers to select from a graphic of a product and put the resultant value into a form.

Why not use radio buttons next to images?


Christian,

There are rather too many large images to show on one page. I could open another with all images next to radio buttons as you suggest, but how could I pass the chosen option back to the original form so it can be submitted?

So many questions...

TIA,

Rob
Christian J
How about a scrolling DIV (using CSS "overflow: auto") containing images with radio buttons (or checkboxes, if you want to allow multiple choices)?
Darin McGrew
QUOTE(robgratt @ Apr 25 2007, 05:10 PM) *
I could open another with all images next to radio buttons as you suggest, but how could I pass the chosen option back to the original form so it can be submitted?
This is moving away from a simple form and becoming more of a "web application", but the basic idea is that you have multiple submit buttons on your main form. One of the submit buttons is for selecting the image. When that submit button is chosen, the server-side program that processes the form data will save your current data and return a second form that allows the user to select an image. When that second form is submitted, then the server-side program sends a third form that looks a lot like the first form, except that the selected image is shown, and any of your current data is pre-filled in the other fields.
robgratt
QUOTE(Darin McGrew @ Apr 27 2007, 03:19 AM) *

QUOTE(robgratt @ Apr 25 2007, 05:10 PM) *
I could open another with all images next to radio buttons as you suggest, but how could I pass the chosen option back to the original form so it can be submitted?
This is moving away from a simple form and becoming more of a "web application", but the basic idea is that you have multiple submit buttons on your main form. One of the submit buttons is for selecting the image. When that submit button is chosen, the server-side program that processes the form data will save your current data and return a second form that allows the user to select an image. When that second form is submitted, then the server-side program sends a third form that looks a lot like the first form, except that the selected image is shown, and any of your current data is pre-filled in the other fields.


Hi,

Once again for all who responded. I realise that I maybe should have posted in the PHP section of the board. What you describe is exactly what I want to do. It was the "a third form that looks a lot like the first form, except that the selected image is shown," part that made the lights come on.

Thanks again,

Rob
ravrC
QUOTE(robgratt @ Apr 24 2007, 05:36 AM) *

Hi,
I would like to display images in a list box. I have searched the web, but have not found any way of doing this. PHP, Javascript etc. would be fine. Anyone any ideas?



check this, free code:

http://scbr.com/docs/products/dhtmlxCombo/index.shtml

-C
Christian J
QUOTE(ravrC @ Jun 1 2007, 12:52 AM) *

That select box with icons doesn't work at all if javascript is disabled, or (in IE) if activeX is disabled.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.