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 5 of 5
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Simulate Button Click

    A Form has a <select> list which lists all the directories & files residing in a directory on the server. Users have also been given the provision to navigate to sub-directories residing in this directory (I am doing this using ASP.NET).

    To navigate to a sub-directory, a user has to select the sub-directory from the <select> list to which he wants to navigate to & then click a button (it's not the submit button; it's the usual button). The user is then taken to the selected sub-directory.

    Apart from navigating to a sub-directory in this way, I also want to give users the option to navigate to a sub-directory by double-clicking a sub-directory in the <select> list i.e. when a user double-clicks a sub-directory in the <select> list, he should be taken to that sub-directory. In other words I want the double-click event on the <select> list item to simulate the button click event.

    How do I do this?

    Thanks,

    Arpan

  • #2
    New Coder
    Join Date
    Nov 2004
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have no idea if you can double click <selection>'s

    but you can make an action happen such as submitting or whatever it is that you want to happen fairly easily
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    
    <html>
    <head>
    <title>Page title</title>
    </head>
    <body>
    
    <form>
    <select onchange="alert('changed');">
    <option selected>choose below</option>
    <option>Option 1</option>
    <option>Option 2</option>
    </select>
    
    </body>
    </html>

  • #3
    New Coder
    Join Date
    Sep 2002
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No, no, my dear 6arredja....that's not what I am looking out for.

    Isn't there anything in JavaScript to catch a double-click event on any item in a <select> list?

    Actually I have come across a few sites where I have seen double-clicking an item in a <select> list doing something.

  • #4
    New Coder
    Join Date
    Sep 2002
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    There's a OnDblClick event for <select> lists, my dear. That was what I was looking out for.

    I already have a button click event function using which users can navigate to different sub-directories. I just assigned the same function to the OnDblClick event of the <select> list!

    That's it!!

  • #5
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is called ondblclick. Try this example.

    Code:
    <select name="s" size="3" ondblclick="alert(this.options[this.selectedIndex].text);">
        <option>This</option>
        <option>That</option>
        <option>The other</option>
    </select>
    david_kw

    Edit: Looks like you found it yourself. :)


  •  

    Posting Permissions

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