Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Trying to create unique textbox name for databse results

    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?

  • #2
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Session("SphereAlloy1") = Request.Form("SphereAlloy1")
    ----
    If you want to get the value of "SphereAlloy1" You must submit this page first.

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK. Then how can I do it without submitting the pages?

  • #4
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Session is on server-side, so you must submit.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •