Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-28-2010, 09:01 AM   PM User | #1
dev.sheoran
New to the CF scene

 
Join Date: May 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
dev.sheoran is an unknown quantity at this point
Question select html control with javascript? Need Help.

Hi All,
I have a select html control as below ;
<SELECT >
<OPTION VALUE="1"> This is option 1 </OPTION>
<OPTION VALUE="2" >This is option 2 </OPTION>
<OPTION VALUE="3" >This is option 3 </OPTION>
</SELECT>

My requirement is that when user moves pointer over the items the value of the item should be shown in a hint box.

How could I show the value of the item in a hint box as user moves pointer over an item using javascript?

Thanks,
Dev
dev.sheoran is offline   Reply With Quote
Old 05-28-2010, 09:32 AM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,100
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by dev.sheoran View Post
My requirement is that when user moves pointer over the items the value of the item should be shown in a hint box.

IE does not support events on the option element. However, it is possible do this in Firefox. Before posting any code please advise whether or not you wish to proceed, bearing in mind that IE cannot do what you require.

The following works in Firefox only:-

Code:
<select id="users" name="users" size = "3">
<option onmouseover="alert('Philip M')">Philip M</option>
<option onmouseover="alert('Old Pedant')">Old Pedant</option>
<option onmouseover="alert('Abduraooft')">Abduraooft</option>

</select>
All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

Last edited by Philip M; 05-28-2010 at 09:44 AM..
Philip M is offline   Reply With Quote
Users who have thanked Philip M for this post:
dev.sheoran (05-28-2010)
Old 05-28-2010, 11:06 AM   PM User | #3
Dormilich
Senior Coder

 
Dormilich's Avatar
 
Join Date: Jan 2010
Location: Behind the Wall
Posts: 2,907
Thanks: 10
Thanked 293 Times in 289 Posts
Dormilich is on a distinguished road
I’d just use the title attribute …
__________________
please post your code wrapped in [CODE] [/CODE] tags
Dormilich is offline   Reply With Quote
Old 05-28-2010, 12:17 PM   PM User | #4
dev.sheoran
New to the CF scene

 
Join Date: May 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
dev.sheoran is an unknown quantity at this point
Thanks Philip M for your suggestion.
But I am using IE6 and need some solution for IE6.
dev.sheoran is offline   Reply With Quote
Old 05-28-2010, 12:18 PM   PM User | #5
dev.sheoran
New to the CF scene

 
Join Date: May 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
dev.sheoran is an unknown quantity at this point
Ya, I'll take care in future. Actually this is my first post in this forum.
dev.sheoran is offline   Reply With Quote
Old 05-28-2010, 12:53 PM   PM User | #6
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,100
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by dev.sheoran View Post
Thanks Philip M for your suggestion.
But I am using IE6 and need some solution for IE6.
Sorry, but I know of none. As I say, IE does not support events on the option element.
Philip M is offline   Reply With Quote
Old 05-28-2010, 01:35 PM   PM User | #7
dev.sheoran
New to the CF scene

 
Join Date: May 2010
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
dev.sheoran is an unknown quantity at this point
Thanks Dormilich for your reply..
But I am using IE6 and title attribute not working in IE6..
dev.sheoran is offline   Reply With Quote
Old 05-28-2010, 09:54 PM   PM User | #8
chockomonkey
New to the CF scene

 
Join Date: May 2010
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
chockomonkey is an unknown quantity at this point
Quote:
Originally Posted by dev.sheoran View Post
Thanks Dormilich for your reply..
But I am using IE6 and title attribute not working in IE6..
since starting to do web design, varying browsers and support for different variables has been a pita.

Why do people still use IE6? ... or any old browser, other than simply being so computer illiterate that they don't even know they need an upgrade, let alone how/where to get it.
chockomonkey is offline   Reply With Quote
Old 05-29-2010, 07:32 AM   PM User | #9
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,100
Thanks: 197
Thanked 2,421 Times in 2,399 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
It would not matter which version of IE dev.sheoran is using. No version of IE supports events on the option element.

IE6 is still in widespread use, especially in corporate environments. Many people sensibly chose not to upgrade to the flaky IE7. IE8 is much better.
Philip M is offline   Reply With Quote
Reply

Bookmarks

Tags
javascript, select

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:12 AM.


Advertisement
Log in to turn off these ads.