...

View Full Version : Trying to create unique textbox name for databse results



KeithWarren
12-13-2006, 06:29 AM
I have a query that pulls records from a database and puts the data into textboxes. I need the text boxes to have unique names such as text1,text2, text3, etc so that I can use the data later.

Here is the code I'm using.

<%i=0%>
<%SQL = "SELECT SphereAlloy FROM QuotedItemsQuery WHERE ([Email] = '" & Session("Email") & "' AND [RFQNumber] = " & Quote & " );"

SET RS = Conn.Execute(SQL)
While NOT RS.EOF
i=i+1%>
<input type="text" name="SphereAlloy<%=i%>" size="9" value="<%=RS("SphereAlloy")%>">

<%
RS.MoveNext
WEND
Set RS = NOTHING
%>

<%
Session("SphereAlloy1") = Request.Form("SphereAlloy1")
response.write Session("SphereAlloy1")
response.write i
%>

Everything works except the textbox name is not getting the numeric increment from i.

Response.write i shows the correct number, but response.write session("SphereAlloy1") shows nothing.

What am I doing wrong?

njzy
12-13-2006, 09:42 AM
Session("SphereAlloy1") = Request.Form("SphereAlloy1")
----
If you want to get the value of "SphereAlloy1" You must submit this page first.

KeithWarren
12-14-2006, 01:13 AM
OK. Then how can I do it without submitting the pages?

njzy
12-14-2006, 02:21 AM
Session is on server-side, so you must submit.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum