Results 1 to 5 of 5

Thread: click event for <select> <option>

  1. #1
    Join Date
    Sep 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default click event for <select> <option>

    Is there a method I can call to click on a particular <option> within a <Select>?
    I've got a select with several <option> lines,and I have the ID of the one I want to click, but have tried .click() but that doesn't work. It always picks the top of the list, and reading up on it, it sounds like the click isn't what I'd choose. Is there another?

  2. #2
    Join Date
    Sep 2005
    Location
    Connecticut
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    ok... srry i didnt understand

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,373
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    There is nothing I know of you can call to click on an option. I have heard of simulated events but, as far as I can tell they are unreliable. You could ask a friend to do it for you. Mostly, only the user can click on something. Sounds like you might want to have a certain item from the list selected on the basis of some other event on the page or just upon page load. If it is just upon page load, give the desired option the selected attribute:
    Code:
    <option selected>This is selected</option>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Sep 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think he meant that by selecting an option to further access it, without providing any submit button,


    dude, that has to go with asp

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,373
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    Well, did you, HockeyFan? That can be done with javascript. This is the HTML forum.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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