473,416 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

HTML <select> different width when expanded

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

thanks!

Sep 18 '06 #1
7 10892
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Salve Håkedal | last post by:
When I select Februar here and sends, selection returns to Januar. I know why: no option is marked selected... But can php get this right in an easy way? <html><head><title>Part of a bigger...
2
by: Mad Scientist Jr | last post by:
I'm trying to get javascipt select all items in a HTML form <SELECT> control and submit the form to an asp.net page. For some reason when the link is clicked, you can see the items all get...
1
by: Mariusz | last post by:
Hi does anyone know an easy way to define object <select> in that way when clicking on it works as right alt is used. In other words - I need to rebuild select than when I click on first option...
6
by: Chris Fink | last post by:
Does anyone know it is possible to include a small image(.gif .jpeg) within a <SELECT><option> so that the user would see the option text as well as a little image(icon) in the option? I know this...
1
by: Knut-Frode Dagestad | last post by:
I have a <selectlist in some html code with hundreds of options. Is it possible to use javascript to jump to the next/previous item in the list? Knut-Frode
4
by: Man-wai Chang | last post by:
-- iTech Consulting Co., Ltd. Expert of ePOS solutions Website: http://www.itech.com.hk (IE only) Tel: (852)2325 3883 Fax: (852)2325 8288
5
by: TomT | last post by:
Hello, I'd like to create several home pages, all with the same HTML code but different CSS settings. I would then allow the visitor to choose which home page to view. This is pretty easy if I...
7
by: Zhang Weiwu | last post by:
Dear all How does javascript realiablily tell if a variable is a reference to an HTML Element "<select>", without causing browser to pop up error message? if (variable.constructor ==...
4
by: mark4asp | last post by:
I have an element, report which contains tags which have been transformed. E.g. <pis &lt;p&gt <myXml> <report>This text has html tags in it.&lt;p&gt which but <has been changed to &lt;&gt</report>...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.