• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to fix dropdown width

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thanks in Advance,

Aditi
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IE renders the select differently then Mozilla, IE will not show anything cut off in the width....

Eric
 
Aditi Gubba
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Thanks,
Aditi
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe you can try style="width:40mm"

setting the width is still going to chop it off....

Eric

[ April 07, 2005: Message edited by: Eric Pascarello ]

Right .. my mistake ..

Amber
[ April 07, 2005: Message edited by: Amber Vaidya ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic