<select: list of images?

J

Jonathan Allen

Hi !

Is there any way to have a <select> list of images? I assume you'd put
value=<xxx> in each <option>, so that you could process the result. Something like:

<select>
<option value=1><img src=1.jpg></option>
<option value=2><img src=2.jpg></option>
</select>

Normal HTML doesn't see to do this for me, but are there any other ways to make
this effect work?

Jonathan
 
J

Jukka K. Korpela

Scripsit Jonathan Allen:
Is there any way to have a <select> list of images?
No.

I assume you'd put value=<xxx> in each <option>, so that you could
process the result.

Apparently, but this has nothing to do with images.
Something like:
<select>
<option value=1><img src=1.jpg></option>
<option value=2><img src=2.jpg></option>
</select>

It's something like invalid markup with no defined meaning.
Normal HTML doesn't see to do this for me, but are there any other
ways to make this effect work?

Yes, and we could tell you, but then we would have to... make sure that
you don't use it, so what's the point? (You would have to use something
fairly complicated, involving CSS and JavaScript, and how would you make
sure that the page is still usable when images are not displayed, for
example? And how would the poor user know how to use your strange select
menu?)

What is the specific problem you are trying to crea^H^H^H^Hsolve?
 
T

Travis Newbury

Is there any way to have a <select> list of images?

According to Jukka no (and he is usually right when it comes to HTML
and CSS)
Normal HTML doesn't see to do this for me, but are there any other ways to make
this effect work?

Yes, you can use smoke and mirrors. Through the use of javascript,
maybe Flash, tables with graphic "bullets", the label tag, and hidden
form fields you can probably come up with a way that it appears to the
user to be a list of images.
 
R

richard

Hi !

Is there any way to have a <select> list of images? I assume you'd put
value=<xxx> in each <option>, so that you could process the result. Something like:

<select>
<option value=1><img src=1.jpg></option>
<option value=2><img src=2.jpg></option>
</select>

Normal HTML doesn't see to do this for me, but are there any other ways to make
this effect work?

Jonathan


One possible way might be to use PHP instead.
With PHP you can use the command "Case select".
This would in effect do what you want.
With case select you can use those img links.
 
J

Jonathan Allen

Jukka,
What is the specific problem you are trying to crea^H^H^H^Hsolve?

We are working on Hebrew spelling. Most browsers cannot be relied upon to have
a decently legible Hebrew font, so in general we're using lots if GIF images
which load quite quickly and are fairly small. I want to have a set of
drop-down lists where people take a test by selecting different spellings that I
can then mechanically mark in Javascript for instant response and also send back
to the server in a form for manual interaction.

Jonathan
 
J

Jukka K. Korpela

Scripsit Jonathan Allen:
We are working on Hebrew spelling. Most browsers cannot be relied
upon to have a decently legible Hebrew font, so in general we're
using lots if GIF images

That sounds like a clumsy and dated approach. I would expect that if the
user can read Hebrew, he has or he can find a browsing environment where
Hebrew characters are available in fonts. They do _not_ need a "Hebrew
font" but any suitable font that has Hebrew letters. This could mean a
common font like Times New Roman or Arial in any reasonably modern
system.

If you however decide to use images, then you can use a set of radio
buttons with associated labels, and the labels may contain or consist of
images. If you instead use <select>, you paint yourself into a corner,
I want to have a set of drop-down lists where people take a
test by selecting different spellings

This is surely easier to the user if all alternatives are visible at a
time without need to open a dropdown menu. So radio buttons are better
even if you present the alternatives as text, as you should.
 
A

Adrienne Boswell

One possible way might be to use PHP instead.
With PHP you can use the command "Case select".
This would in effect do what you want.
With case select you can use those img links.

PHP is server side and has no knowledge of the client.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top