asp classic

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AspclassVilaspatil198
    New Member
    • Apr 2008
    • 1

    #1

    asp classic

    how to get combo box select text. i have used post method and now i want to display the content text of the combo its gives me number all the combo fields are populated from db and when i wrote
    vcat = request.form("c bocat")
    its give me 273 i want the text decoratives how i wl do that
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi there,

    That information is not passed through the form submit so if you want to retreive it you'll need to pass it as part of the value of the combo box option and parse it out when you retreive it. Like this:
    [HTML] <select name="Combo1">
    <option value="23,Foo"> Foo</option>
    <option value="7,Bar">B ar</option>
    </select>
    [/HTML]
    Code:
    <%
    Dim aCombo1
    If InStr(Request.Form("Combo1"), ",") > 0 Then
    	 aCombo1 = Split(Request.Form("Combo1"), ",")
    	 Response.Write "The selected value was " & aCombo(0) & "<br />"
    	 Response.Write "The selected text was " & aCombo(1)
    End If
    Hope this helps,

    Dr B

    Comment

    Working...