SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    jQuery with Form Fields

    Hi all... I'm fairly rubbish at JavaScript, and fairly new to jQuery, but this seems like the simplest of tasks. I just can't get it to work!

    How do you use jQuery to access the selected element of a dropdown list?

    At the moment, I have:

    width = $(#myform select).val();

    but it is just returning null. How do you get to the value of a select element with jQuery?

    Cheers,

    Chris

  2. #2
    SitePoint Wizard silver trophybronze trophy Stormrider's Avatar
    Join Date
    Sep 2006
    Location
    Nottingham, UK
    Posts
    3,133
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    OK, problem solved, it works now. I had a problem with the selector.


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
  •