473,511 Members | 15,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

select width issue in IE with long options

2 New Member
Greetings,

I have a 220px wide column in which I am presenting a wide variety of select's. I am setting the width of the select to 220px and have dynamically generated option's with a wide range of lengths, most of which are in excess of the 220px select width. In Firefox 2.x it works as I would like it to, meaning that the select field is remaining at 220px, while the options list will dynamically expand in length, if necessary, when pulled down to show the entire length of the long options.

In IE6 and IE7, the length of the option is being inherited from the select statement and is being clipped to the same length as the specified select width.

I have tried forcing the width of the option, but IE (6 & 7) appear to be ignoring the width attributed being set on the option itself.

Any ideas or workarounds for IE?

Thanks,
Derrick
Dec 27 '07 #1
3 6345
Death Slaught
1,137 Top Contributor
Please post your code.

Thanks, Death
Dec 27 '07 #2
freerange
2 New Member
Sorry. Here is a simple example.
IE6 or IE7 will show you the truncated options, FF2.x leaves options non-truncated.

[html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test</title>
</head>
<style type="text/css">
#container {
width: 150px;
border: 1px solid #f00;
padding: 10px;
margin: auto;
background-color: #eee;
}
#container select {
width: 120px;
}
</style>
<body>
<div id="container">
Select a Product: <select>
<option>Select One...</option>
<option>Really, really long option that is longer than the select width</option>
<option>Here is another really long option that is longer than the select width</option>
</select>
</div>
</body>
</html>
[/html]
Dec 27 '07 #3
drhowarddrfine
7,435 Recognized Expert Expert
The bad news is width doesn't work on <select> in IE.
The good news...well...there is no good news.
Dec 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3013
by: Sjaakie | last post by:
Hi there, I'm trying to get this working with Firefox. Can you point out what's wrong? No problems with IE, Firefox doens't fill selMonth... TIA >>> the script... >>> <select name="selDay"...
5
2377
by: callmebill | last post by:
I'm relatively new to javascript, and I'm trying to decide whether the following (and if so, clues on how to do it): I'd like to create two HTML multiple-select boxes. The first would be a list...
7
1894
by: sean | last post by:
SELECT drop-list width incorrect for long text when SELECT is fixed width Setting the width style of a SELECT statement causes the contents of the drop-list to be cropped. This is problematic...
7
6218
by: srt5k | last post by:
I have a web page with 2 html multiple select boxes on it, and I use javascript to dynamicaly copy options from one box to another, before deleting the option from the first box. My issue is...
16
2721
by: Richard Maher | last post by:
Hi, I have this Applet-hosted Socket connection to my server and in an ONevent/function I am retrieving all these lovely rows from the server and inserting them into the Select-List. (The on...
1
5040
by: madflytom | last post by:
Hello, I'm trying to move the options of one select list to another select list. The "source" select list is divided into optgroups, and the "target" select list is not. I want to somehow keep...
5
26309
by: pravinnweb | last post by:
I have a form with lots of select boxes with fixed widths in order to fit in with the design. The problem I have is that some of the values in the options are much wider than the select box so the...
25
5364
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. ...
4
10648
tjc0ol
by: tjc0ol | last post by:
Hi guys, I'm a newbie in php and I got error in my index.php which is: 1054 - Unknown column 'p.products_id' in 'on clause' select p.products_image, pd.products_name, p.products_id,...
0
7245
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7356
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
7427
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...
1
7085
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
7512
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
5671
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4741
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...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.