954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

title attribute with drop down

hii
my drop down box contains very long names...
if i increase the length of the box it doesn't looks good
so i was wondering if i could somehow show the complete name inthe tooltip or title when the value is selected in the drop down list....

i am picking the values from the database

i read somewhere that title is not supported by w3c..

any suggestions ??
thanks........

aashishn86
Junior Poster
188 posts since Jun 2008
Reputation Points: 10
Solved Threads: 9
 

Aashishn86,

You could try this approach. It works in isolation but on a real page would cause the page to reflow as it resizes. Therefore of limited utility.

<html>
<head>
<title>Airshow :: Untitled</title>
<style type="text/css">
{}
</style>

<script>
function expand(s, b){ s.style.width = (b) ? '' : '100px'; }
</script>
</head>

<body>
<select style="width:100px;" onfocus="expand(this, 1);" onblur="expand(this, 0);">
	<option value="1">111111111111</option>
	<option value="2">222222222222222222222</option>
	<option value="3">333333333333333333333333333333</option>
</select>
</body>
</html>


Airshow

Airshow
WiFi Lounge Lizard
Moderator
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
 

thanks
but my form has lots of text boxes and drop downs ....
can't really play with the layout...

aashishn86
Junior Poster
188 posts since Jun 2008
Reputation Points: 10
Solved Threads: 9
 

I guessed as much.

The problem is - if you allow enough space for it to expand into, then it might as well be full width in the first place!

Maybe someone else has a better idea.

Good luck

Airshow

Airshow
WiFi Lounge Lizard
Moderator
2,683 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You