Previous Next

Thread: find which value was selected from combobox

Last post 05-06-2008 12:50 PM by MyronCope. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 05-04-2008, 6:59 PM

    find which value was selected from combobox

    question,

    i am binding the field called Style_name to my combobox but on the next page i have an input field that grabs the styleType value selected in this combobox, i need to know how to set the styleType input so the next page can print that out. 

    to be clear, its filling up with all the right values i just need to know how to get the value selected.

    what i have so far is this but its not working

    what am i doing wrong here? 

    <CODE> 

    <input type="hidden" name="StyleType" value="rsStyle('Style_Name')" />

    <select onchange="BLOCKED SCRIPT__StyleChanged()" name="PopulateStyle" size="1" style="width:400px">

    <option value="0~">No Style Selected</option>

    <%

    While not rsStyle.EOF

    %>

    <option value="<%=rsStyle("Style_Name")%>"

    <%if Request.QueryString("StyleType")="rsStyle("Style_Name")" then%>selected<%end if%>>

    <%=rsStyle("Style_Name")%>

    </option>

    <%

    rsStyle.MoveNext

    Wend

    If rsStyle.State = adStateOpen Then rsStyle.Close

    Set rsStyle= nothing

    %>

    </CODE>

  • 05-05-2008, 8:40 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Lawrenceville, NJ
    • Posts 3,836
    • IIS MVPs

    Re: find which value was selected from combobox

    In the next page you need to reference Request.Form("PopulateStyle").

  • 05-05-2008, 9:26 AM In reply to

    Re: find which value was selected from combobox

    Thanks Tom,

    i'm doing what you suggested but its giving me "undefined" for the value so I wonder if i need to change the code in my combobox

  • 05-05-2008, 9:30 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Lawrenceville, NJ
    • Posts 3,836
    • IIS MVPs

    Re: find which value was selected from combobox

    The code I gave you was for server-side Classic ASP.  Are you trying to use it as client script?

  • 05-05-2008, 9:32 AM In reply to

    • tomkmvp
    • Top 10 Contributor
    • Joined on 03-20-2003, 10:27 AM
    • Lawrenceville, NJ
    • Posts 3,836
    • IIS MVPs

    Re: find which value was selected from combobox

    OK ... wait ... I re-read your original post.  Why are you using the hidden field?

  • 05-06-2008, 12:50 PM In reply to

    Re: find which value was selected from combobox

    the post i marked as answer above was right, thanks for your help

Page 1 of 1 (6 items)
Page view counter