dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: value of a drop down

  1. #1
    Join Date
    Feb 2003
    Posts
    2

    value of a drop down

    I've tried:
    document.form1.response.options[document.form1.response.selectedIndex].value

    but that doesn't work. Trying to determine the value of one of my drop downs.

    thanx.

  2. #2
    Join Date
    Feb 2003
    Posts
    28
    This:

    document.form1.response.options[document.form1.response.selectedIndex].value

    is correct syntax. Check your form name and control name to make sure they are correct. Otherwise, post the HTML for your entire SELECT object.

    Lin

  3. #3
    Join Date
    Feb 2003
    Posts
    2
    thanx, it got me to look at it again, and though the syntax was correct, I didn't realize that the <option> tags value has to be set. It typically defaults to what is between the tags for the value if it has not been set. But in this case it must be set as value=" "...<option value="12345">12345</option>

    thanx.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles