PDA

View Full Version : showing full content of options in IE even by specifying fixed width to select elemen


radhika118
11-18-2005, 02:49 PM
We got some issue. we need to display list of questions. But the current design of page doesn't allow width more than 190px. If drop down list has longer question then its disturbing complete UI look and feel as background images are used.
If I specify limited width to select element then IE is truncating options instead of showing it in full.
Do we have any work around to show complete option element data even in IE (even though we set fixed width for select element)?
I will appreciate any help.

_Aerospace_Eng_
11-18-2005, 02:58 PM
You could use some javascript
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
select {
width:190px;
position:absolute;
}
</style>
</head>

<body>
<form>
<select onclick="this.style.width='400px'" onkeyup="this.style.width='400px'" onblur="this.style.width='190px';">
<option value="#">This is a short option</option>
<option value="#">This is a very long option that extends the select menu</option>
</select>
</form>
</body>
</html>