Hi, I have a dropdown where I need to fix the width of the dropdown at the design time. At runtime when I click on the dropdown it should show me the full width of the options. Please look at the following code and let me know what the problem is.
<SELECT name="ReasonforOverride" class="hiddendiv" style="width:40%;"> <option value="" selected ></option> <option value="Past DOF violation" >Past DOF violation</option> <OPTION value="Trend Analysis" >Trend Analysis</OPTION> <OPTION value="Stale Fiscal Year End Statements" >Stale Fiscal Year End Statements</OPTION> <OPTION value="Good or bad" >Exceptionally good or bad fisical year end results based on extraordinary event</OPTION> <OPTION value="Significant" >Significant life event</OPTION> <OPTION value="Other" >Other</OPTION> </SELECT>
CSS for hiddendiv
/* for hidden div tags */ .hiddendiv {
display: none;
}
This works fine in Mozila but not in IE. Where am I doing wrong? Please let me know.
Hi Eric, Thanks for the response. How to deal with this kind of situations. If I don't fix the width of the dropdown at design time it will take maximum width of the options and sets the dropdown width whick looks ugly. So, I want to fix the width first and at runtime when user clicks on the dropdown he should able to read full length. Please let me know how to deal with this.
Sorry to say that there is no real fix. IE does not render form elements that way. Either you are going to have to allow it to be full length, or deal with it being chopped off.