By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,116 Members | 1,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,116 IT Pros & Developers. It's quick & easy.

HTML <select> different width when expanded

P: n/a
Hi, is this possible to achieve this, and how?
http://img217.imageshack.us/img217/779/derrrvw2.png

thanks!

Sep 18 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
la******@gmail.com wrote:
Hi, is this possible to achieve this, and how?
http://img217.imageshack.us/img217/779/derrrvw2.png
.... and why?

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
Sep 18 '06 #2

P: n/a
On Mon, 18 Sep 2006 13:53:50 -0700, la******@gmail.com let this slip:
Hi, is this possible to achieve this, and how?
http://img217.imageshack.us/img217/779/derrrvw2.png

thanks!
Have you ever seen this kind of behaviour in an application ? I don't
think this is possible in HTML, and if it was, I imagine it to be
difficult to implement - especially in browsers that use the native
widgets to draw form elements, like IE, Konqueror or Safari.

Thomas Jollans
Sep 18 '06 #3

P: n/a
la******@gmail.com wrote:
Hi, is this possible to achieve this, and how?
http://img217.imageshack.us/img217/779/derrrvw2.png
WHY?

Well your could...

SELECT { width: 10em; }
SELECT OPTION { width: 20em; }

But don't expect it to work in IE!

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Sep 18 '06 #4

P: n/a
Hi,

I'd need this because the image I provided is just for sample. My
select contains fairly large strings, and I don't have enough space on
my page to set the width of my select wide enough to see all text. So I
was wondering if even the select element is somewhat small, it was
possible to at least expand the box to a width so we see all text in
the box that shows all elements when we click on the select.

Jonathan N. Little wrote:
la******@gmail.com wrote:
Hi, is this possible to achieve this, and how?
http://img217.imageshack.us/img217/779/derrrvw2.png

WHY?

Well your could...

SELECT { width: 10em; }
SELECT OPTION { width: 20em; }

But don't expect it to work in IE!

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Sep 18 '06 #5

P: n/a
la******@gmail.com wrote:
>>Hi, is this possible to achieve this, and how?
http://img217.imageshack.us/img217/779/derrrvw2.png
la******@gmail.com wrote:
I'd need this because the image I provided is just for sample. My
select contains fairly large strings, and I don't have enough space on
my page to set the width of my select wide enough to see all text. So I
was wondering if even the select element is somewhat small, it was
possible to at least expand the box to a width so we see all text in
the box that shows all elements when we click on the select.
It sounds to me like a SELECT element isn't the most appropriate choice.
Have you considered radio buttons or checkboxes, which would allow label
text that could wrap to multiple lines as necessary?
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"FAILURE IS NOT AN OPTION. It comes bundled with the software."
Sep 18 '06 #6

P: n/a
no, really, select is the correct choice, believe me

Darin McGrew wrote:
la******@gmail.com wrote:
>Hi, is this possible to achieve this, and how?
http://img217.imageshack.us/img217/779/derrrvw2.png

la******@gmail.com wrote:
I'd need this because the image I provided is just for sample. My
select contains fairly large strings, and I don't have enough space on
my page to set the width of my select wide enough to see all text. So I
was wondering if even the select element is somewhat small, it was
possible to at least expand the box to a width so we see all text in
the box that shows all elements when we click on the select.

It sounds to me like a SELECT element isn't the most appropriate choice.
Have you considered radio buttons or checkboxes, which would allow label
text that could wrap to multiple lines as necessary?
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"FAILURE IS NOT AN OPTION. It comes bundled with the software."
Sep 18 '06 #7

P: n/a
Hello,

la******@gmail.com wrote:
Darin McGrew wrote:
>la******@gmail.com wrote:
>>Hi, is this possible to achieve this, and how?
http://img217.imageshack.us/img217/779/derrrvw2.png

la******@gmail.com wrote:
I'd need this because the image I provided is just for sample. My
select contains fairly large strings, and I don't have enough space on
my page to set the width of my select wide enough to see all text.
You need a larger monitor. ;)
So I
was wondering if even the select element is somewhat small, it was
possible to at least expand the box to a width so we see all text in
the box that shows all elements when we click on the select.
But the text will be cropped, when the SELECT is not expanded, and the user
has to click on it, in order to read it - not a good idea.
>It sounds to me like a SELECT element isn't the most appropriate choice.
Have you considered radio buttons or checkboxes, which would allow label
text that could wrap to multiple lines as necessary?

no, really, select is the correct choice, believe me
Unless you provide more context, we have to guess and rely on our
experiences. And this experience tells us that in 99.9% the question is
not "How do I implement XYZ?", but "How do I construct a document so I
don't have to do XYZ?".

To me, this sounds like your layout is much too rigid, and you are suffering
from the consequences of this approach. You can't control how large the
browser window, font size, ... is anyway. If there is enough space to have
the (wide) select and submit button side-by-side, fine. When there is not
enough horizontal space, nobody gets hurt, if the submit button is placed
below the select and the user has to scroll a bit in order to see the
complete document (which is less efford than clicking on the select
control(s) in order to see which option is active).
HTH

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
Sep 19 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.