SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Evangelist jazztie's Avatar
    Join Date
    Mar 2001
    Location
    the Netherlands
    Posts
    519
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have filled a LIST/MENU with dynamic content.
    The value of an <option> is a number (id)...

    How can I read out which item is selected when the form is submitted?

  2. #2
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I assume you're not using anything server side to get the value since this is posted in the client side forum?

    JavaScript can get the value of a select menu like this:

    document.formName.selectName[document.formName.selectName.selectedIndex].value

    You could use an onSubmit event handler in your form tag to call a function and get the menu's value, performing an action depending on what option was selected.


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
  •