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 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question pulling face value from list options

    Mind my ingorance...
    I have a drop down list which is similar to as follows:

    <Input......>
    <option Value="001">Red</Option>
    <option Value="002">Blue</Option>
    <option Value="003">Green</Option>
    <option Value="004">Purple</Option>
    ....

    i only want to grab the face (name of the color) value... not the actual value to the selected option, then simpley drop it into a text box.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    New York, USA
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts
    check this out...

    <form>
    <select name="tst">
    <option Value="001">Red</Option>
    <option Value="002">Blue</Option>
    <option Value="003">Green</Option>
    <option Value="004">Purple</Option>
    </select>
    <input type="button" value="test" onClick="alert(this.form.tst[this.form.tst.selectedIndex].text);">
    </form>

    It's the text property you're after...
    good luck

  • #3
    New Coder
    Join Date
    Aug 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    5w33t

    thanx



  •  

    Posting Permissions

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