Solved

Dynamically resize combo box based on content in HTML or DHTML.

Posted on 2003-10-24
1
585 Views
Last Modified: 2007-12-19
We are using Internet Explorer 6 with an intranet based application.

I have some select elements in my web pages where the content in longer than the width of the drop down combo box itself.

Is there any way where the drop down can dynamically resize itself, specifically the text area, depending on the content, in html or dhtml.


Thanks in Advance
John
0
Comment
Question by:jtrapat1
1 Comment
 
LVL 15

Accepted Solution

by:
VincentPuglia earned 125 total points
ID: 9617704
Hi,

Like this?

<html>
<body>
<form>
<select style="width:100px" onfocus="this.style.width=''" onblur="this.style.width='100px'" >
<option selected>Table of Contents</option>
<option>1.Short Text</option>
<option>2. Not So Really Long Outrageous Text</option>
<option>3. Somewhat Ludicruous (check that spelling) But, Not So Really Long Outrageous Text</option>
</select>
</form>
</body>
</html>

Vinny
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now