Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 2003-10-24
1
591 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Find out what you should include to make the best professional email signature for your organization.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

809 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