Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update text from combo....

Status
Not open for further replies.

mjonson

Technical User
Mar 9, 2004
128
GB
Hi,

I want to be able to select an item from a list and then
have the cost of the item to be displayed in a response.write - so far i have a combo
-the value i choose from the list is warranty
-the value i want displayed is warrcost

Code:
<%
x_warridList = "<select name='x_warrid'><option value=''>Please Select</OPTION>"
sqlwrk = "SELECT `warrid`, `warranty`, `warrcost` FROM `tbl_warranty`" & " ORDER BY `warranty`"
Set rswrk = Server.CreateObject("ADODB.Recordset")
rswrk.Open sqlwrk, conn, 1, 2
If Not rswrk.Eof Then
    datawrk = rswrk.GetRows
    rowswrk = UBound(datawrk, 2)
    For rowcntwrk = 0 To rowswrk
        x_warridList = x_warridList & "<option value='" & datawrk(0, rowcntwrk) & "'"
        If CStr(datawrk(0, rowcntwrk)&"") = CStr(x_rflid&"") Then
            x_warridList = x_warridList & " selected"
        End If
        x_warridList = x_warridList & ">" & datawrk(1, rowcntwrk) & "</option>"
    Next
End If
rswrk.Close
Set rswrk = Nothing
x_warridList = x_warridList & "</select>"
Response.Write x_warridList
%>
 
Hey check out this asp forum post, and read my post near the bottom... should point you in the right direction...

thread333-957361

If you need more help let me know.

Jason


www.sitesd.com
ASP WEB DEVELOPMENT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top