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 5 of 5

Thread: listbox text

  1. #1
    tib
    tib is offline
    New Coder
    Join Date
    Apr 2005
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    listbox text

    Hi I wanted to get the text from the selected items in a list box, the value of the list box item is already being used to obtain the key of the value selected. I know in asp.net you can get the text by using the .text method but is tere a way in asp to do the same? Thanks for any input

  • #2
    New Coder
    Join Date
    Aug 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This seems like more like a DHTML/Javascript DOM question than an ASP question. I would suggest you look into the getElementById() function coupled with the .value property of the element the first finction returns.

    i.e:
    Code:
    var html_element = getElementById("list_select");
    var values = html_element.value;
    Don't quote me on the syntax though

  • #3
    tib
    tib is offline
    New Coder
    Join Date
    Apr 2005
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the reply... but will this return the value of the option instead of the text? thanks

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    when you ahve a reference to the option-object, in javascript, you can get the text by optionreference.text. Asp can get just the posted value, not the text within the optiontags
    I am the luckiest man in the world

  • #5
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    With classic ASP you can't really get the text. But on the page that you need it of course you could simply get the text straight from the database table based on the ID...
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips


  •  

    Posting Permissions

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