Results 1 to 2 of 2

Thread: [RESOLVED] Easy Question

  1. #1

    Thread Starter
    Fanatic Member VBKNIGHT's Avatar
    Join Date
    Oct 2000
    Location
    Port25
    Posts
    619

    Resolved [RESOLVED] Easy Question

    HOw can I get the user input value using select on vbscript?


    <select bblahblahblah onchange=dothis>
    <option>
    <option>
    </select>

    If a post has helped you then Please Rate it!

  2. #2
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Its the same as Javascript really... but you're not familiar with Javascript then heres an example

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
    <title>VBScript Dom</title>
    <script language="VBScript">
    <!--
    Function getSelect(objectID)
    Msgbox ("Value " & document.getElementById(objectID).value & " selectedIndex " & document.getElementById(objectID).selectedIndex)
    End Function
    //-->
    </script>

    </head>
    <body>
    <select name="selectbox" id="selectbox" onchange="getSelect('selectbox')">
    <option value="item1">Item1</option>
    <option value="item2">Item2</option>
    <option value="item3">Item3</option>
    </select>
    </body>
    </html>

    .value returns option value
    .selectedIndex returns an number of the current selected item where 0 is the top
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

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