Jump to content

Drop Down List problem in IE


Recommended Posts

Hi all,I need ur help to figure out how to solve this.Problem is:In FireFox my code for drop down is working good. But in IE it wont did its job

<div class="left"><p><label class="prolabel">Types</label></p></div><div class="right"><select class="ddl" id="packing" name="packing"><option selected="selected">select</option><option>abcdefghijklmnopqrstuvwxyz</option>	<option>abcdefghijklmnopqrstuvwxyz</option></select></div>

I have css code as

.form-details1 select{	width:190px;}

Screen Shots are attached.Please i need to solve this now.In Internet Explorer 8examinie.jpg In Firefox examinfirefox.jpg

Edited by selvamanikandan
Link to post
Share on other sites

What's not working? Remember, you did set its width to 180px.

Link to post
Share on other sites
What's not working? Remember, you did set its width to 180px.
u r right.but in firefox the length of options is clearly viewable.But in ie i got exactly the size . it cuts the options length.Do u understand what i am trying to say.Thanks for ur reply.
Link to post
Share on other sites

I would either set a longer width or use shorter option values? Figure out your longest option value and then trial and error the width to meet the requirement of the longest value.

Link to post
Share on other sites

What your seeing is a browser specific rendering of an element. A browser decides how to handle the options when they are longer than the width of the select. As far as I know there isn't anything in CSS you can do to make IE render it like FF does.So your only option is to change the width of your select or the length of your options.

Link to post
Share on other sites
What your seeing is a browser specific rendering of an element. A browser decides how to handle the options when they are longer than the width of the select. As far as I know there isn't anything in CSS you can do to make IE render it like FF does.So your only option is to change the width of your select or the length of your options.
thanks guys for the replies.So i have to go for javascript to replace the dropdown list.Because i wont able to do shorten the length of options and it may rise some confusionand i wont able to lengthen the width of total select. because i makes my form some damage in view.Thanks and if u figure out any improvements reply me..
Link to post
Share on other sites
thanks guys for the replies.So i have to go for javascript to replace the dropdown list.Because i wont able to do shorten the length of options and it may rise some confusionand i wont able to lengthen the width of total select. because i makes my form some damage in view.Thanks and if u figure out any improvements reply me..
are you getting you're option's dynamically?
Link to post
Share on other sites
So i have to go for javascript to replace the dropdown list.
Yes, that's likely the route you'll need to take. You'll have to create your list using other elements (a <ul> for example) and use the onclick handler to fire some javascript that will show/hide the <li> elements within your list.The only drawback is that users who have javascript disabled won't be able to use the dropdown at all. So you'd probably do well to come up with something to accommodate those users.
Link to post
Share on other sites

I'm not sure what kind of performance issues you could run into, but you could test the length of all incoming option values (as strings), check their length and then set the width equal to that value but in em's (of the longest one).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...