Getting selected option

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aspMAXX
    New Member
    • Sep 2006
    • 1

    Getting selected option

    Simple question:
    I have s selection box after the user makes a selection I want to capture the selection and use it to go to my database. How do I do it?
  • phpmaet
    New Member
    • Sep 2006
    • 27

    #2
    Hi,
    This code very useful for you. try this code,


    Code:
    <form method=post action=form-checkboxck.asp>
    <input type=checkbox name=t1 value='PHP'>PHP
    <input type=checkbox name=t1 value='ASP.NET'>ASP.NET
    <input type=checkbox name=t1 value='PEAR'>PEAR
    <input type=checkbox name=t1 value='JAVA'>JAVA
    <input type=submit value='Submit'>
    </form>
    The form is submitted then the values of the checked checkboxes.


    Code:
    Dim mode,mode_a,i
    mode=Request("t1")
    Let us split the string to get the array of checked values.

    Code:
    mode_a=split(mode,",")
    Using 'For' loop and 'LBound/UBound' function to print out the checked values of the checkboxes.


    Code:
    For i=LBound(mode_a) to UBound(mode_a)
    Response.Write mode_a(i) + "<br>"
    Next
    Thanks

    Comment

    Working...