Click to See Complete Forum and Search --> : IE7 + select box width + problem


Jorge Fernandes
07-13-2007, 11:50 AM
I have the same problem as posted here in 2005!! (link (http://www.webdeveloper.com/forum/showthread.php?t=81818))

But now, I have it with Internet Explorer 7

The problem is:

IE doesn't expand the select box when you go past the fixed width.
Is there any way to make it work. It seems to work fine in Firefox

The solutions (that doesn't work with IE7) were:

<select width="70" style="width: 70px" name="test"
onClick="document.form1.test.style.pixelWidth = 100;"
onblur="document.form1.test.style.pixelWidth = 40;">
<option value="1">LINK1 LINK1 LINK1 LINK1 LINK1
<option value="2">LINK2 LINK2 LINK2 LINK2 LINK2
<option value="3">LINK3 LINK3 LINK3 LINK3 LINK3
<option value="4">LINK4 LINK4 LINK4 LINK4 LINK4
</select>

...or...

<select width=aut style="width:70" name="test"
onclick="document.form1.test.style.width = '100px';"
onblur="document.form1.test.style.width = '40px';">
<option value="1">LINK1 LINK1 LINK1 LINK1 LINK1
<option value="2">LINK2 LINK2 LINK2 LINK2 LINK2
<option value="3">LINK3 LINK3 LINK3 LINK3 LINK3
<option value="4">LINK4 LINK4 LINK4 LINK4 LINK4
</select>



Anyone?!

toicontien
07-13-2007, 01:11 PM
Shoot. I didn't see you made a new thread and I posted an answer on the other topic. :)

http://www.webdeveloper.com/forum/showpost.php?p=777326&postcount=8

Code from the other topic:

<script type="text/javascript">
<!-- begin hiding
function expandSELECT(sel) {
sel.style.width = '';
}


function contractSELECT(sel) {
sel.style.width = '100px';
}
// end hiding -->
</script>

<select multiple style="width: 100px;" onfocus="expandSELECT(this);" onblur="contractSELECT(this);">
<option></option>
</select>

Jorge Fernandes
07-13-2007, 01:49 PM
When I click It the size expand! That's ok!
But, then, it doesn't come back to the original size.
How can we solve it?

Jorge Fernandes
07-13-2007, 02:10 PM
Well... my mistake! It come back to the original size!!!!

But here's the problem.

Using JavaScript expandSELECT and contractSELECT functions doesn't work on my project because de cell expands, and all the contents at the write of the cell moves to the right :(((
What I want is Firefox behave : we press, and the options shows with full description, but the select box remains with the same size.