EagerWolf Posted March 5, 2007 Share Posted March 5, 2007 I've got problem in IE... I've got select box ... In firefox width of opened menu is adjusted to string lenght but in IE it can't be read ... Please help .. I am pretty lost Thanks Quote Link to comment https://forums.phpfreaks.com/topic/41181-solved-select-width-in-ie/ Share on other sites More sharing options...
fenway Posted March 5, 2007 Share Posted March 5, 2007 Post your code. Quote Link to comment https://forums.phpfreaks.com/topic/41181-solved-select-width-in-ie/#findComment-199890 Share on other sites More sharing options...
EagerWolf Posted March 5, 2007 Author Share Posted March 5, 2007 <form id="form1" name="form1" method="post" action=""> <label> <select name="select" style="width:150px"> <option value="1">sdasdadasasdsasaddsaasdsa</option> <option value="2">sadasdasfasfasasfasfasf</option> <option value="3">asd</option> </select> </label> </form> If you put this in html file and open it with IE.. You will see, that values (sdasdadasasdsasaddsaasdsa) aren't shown correctly.. box with 150px width is opened when select is clicked... In other site Firefox shows it correctly... Quote Link to comment https://forums.phpfreaks.com/topic/41181-solved-select-width-in-ie/#findComment-200157 Share on other sites More sharing options...
fenway Posted March 5, 2007 Share Posted March 5, 2007 Strange, that should work... don't have IE at work, though. Quote Link to comment https://forums.phpfreaks.com/topic/41181-solved-select-width-in-ie/#findComment-200169 Share on other sites More sharing options...
EagerWolf Posted March 5, 2007 Author Share Posted March 5, 2007 I thought it should work as well ... I've particularly solved problem by setting width:auto ... but that resize me the whole box and it is not what I've wanted ... Quote Link to comment https://forums.phpfreaks.com/topic/41181-solved-select-width-in-ie/#findComment-200209 Share on other sites More sharing options...
nogray Posted March 5, 2007 Share Posted March 5, 2007 IE won't show the entier text in the select menu width is smaller than the option, you need to use a script to resize the width to "auto" when the menu is open using onclick events. It's a bit complicated since you'll need to track if the user clicked on the menu to open it or to close it. Something like this When the user click on the menu, a click counter will recorde the click to 1 which means the menu is open. If the counter is 1 set the width to auto the user make a selection, set the counter to 0 if the counter is 0 set the width to 150 Things you need to worry about is if the user click outside the menu to close (you'll need an onclick event on the body) Quote Link to comment https://forums.phpfreaks.com/topic/41181-solved-select-width-in-ie/#findComment-200342 Share on other sites More sharing options...
EagerWolf Posted March 6, 2007 Author Share Posted March 6, 2007 Thanks for your help! I get it Quote Link to comment https://forums.phpfreaks.com/topic/41181-solved-select-width-in-ie/#findComment-200658 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.