Results 1 to 3 of 3

Thread: DHTML VB6.0 Select Value

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    5
    Hi

    I'm working with VB 6.0 and DHTML.

    I populated a select at runtime with data from a database.

    But now I want to know how to receive a selected data item.
    If I doubleclick the selection I want to get back the selected item.
    I tried it with the selectedIndex command, but I receive only the index position, but not the item value. With outerText I get a long string containing all item values.
    At the moment I am deleting those items, which are not selected and then use the outerText command to get the item value, but there must be an easier way.

    Can anyone help me?

  2. #2
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810
    You need to use the value of the selectedindex:
    Code:
    <SELECT onchange="window.location.href=this.options[this.selectedIndex].value">
      <OPTION VALUE="http://www.microsoft.com/ie">Internet Explorer</OPTION>
      <OPTION VALUE="http://www.microsoft.com">Microsoft Home</OPTION>
      <OPTION VALUE="http://msdn.microsoft.com">Developer Network</OPTION>
    </SELECT>
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    5

    DHTML Select

    Thank you but I'm looking for something else.

    I use VB 6.0 DHTML, no java script, vb script or html.

    The command I'm looking for must be in vb 6.0 and should
    return the string of the selected item.

    Any ideas ?

Posting Permissions

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



Click Here to Expand Forum to Full Width