Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    May 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    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

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,037
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    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.

  • Users who have thanked Philip M for this post:

    dev.sheoran (05-28-2010)

  • #3
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,302
    Thanks
    13
    Thanked 345 Times in 341 Posts
    I’d just use the title attribute …
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #4
    New to the CF scene
    Join Date
    May 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks Philip M for your suggestion.
    But I am using IE6 and need some solution for IE6.

  • #5
    New to the CF scene
    Join Date
    May 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Ya, I'll take care in future. Actually this is my first post in this forum.

  • #6
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,037
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    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.

  • #7
    New to the CF scene
    Join Date
    May 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks Dormilich for your reply..
    But I am using IE6 and title attribute not working in IE6..

  • #8
    New to the CF scene
    Join Date
    May 2010
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #9
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,037
    Thanks
    203
    Thanked 2,539 Times in 2,517 Posts
    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •