Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with AutoSteching a drop-down box

Status
Not open for further replies.

TonyU

Technical User
Feb 14, 2001
1,317
US
[tt]Hello all,
I need help,
I'm building a drop-down box being populated from a database, the problem is that some field names are over 60 bytes long

Q.
How can I set the drop-down to autostrech so to speak?
I know

<style=&quot;width:170;&quot;> will set it to what I specify but I need it to autostrech.

Thanks in advance...



T ® Ñ ¥
To keep a lamp burning we have to keep puting oil in it.
logo.gif

 
Tony,

I believe the width of a drop-down will stretch to fit the longest element in it, unless you tell it otherwise.

thread215-514855 covers dynamically changing the width of a drop-down box. You might find it useful to -- if you just don't know how big your entries will be -- give the drop-down a small footprint unless activated and then make it obscenely huge.

Hope that helps!

Cheers,


[monkey] Edward [monkey]

Like Lovecraft? Know Photoshop? Got time for the Unspeakable?
 
[tt]Thanks for your response Edward, but I'm trying to set width of the drop-down based on the width of the dynamic text




T ® Ñ ¥
To keep a lamp burning we have to keep puting oil in it.
logo.gif

 
It's easy: don't specify a width. The drop-down will stretch to accomodate the elements when the page is built.

Alternately, you can precalculate the width of your drop-down by doing a runthrough of the menu entries before the server app ever builds the page. Save that piece of info as the drop down width, then use it when your app composes and sends the page to the client.

Cheers,


[monkey] Edward [monkey]

Like Lovecraft? Know Photoshop? Got time for the Unspeakable?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top