If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > variable in looping statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-14-04, 15:20
-Dman100- -Dman100- is offline
Registered User
 
Join Date: Jan 2004
Posts: 124
variable in looping statement

How can I generate a different value for the input type "name" in the code?

<form action="" method="post">
<%
Response.Write "<table width=""700"" border=""1"">"
For x = 0 To TEST_MAX
Response.Write "<tr>"
Response.Write "<td>"
Response.Write "<input type='text' name='tbColumn1'" & "value='" &
TestList(0,x) & "'" & ">"
Response.Write "</td>"
Response.Write "<td>"
Response.Write "<input type='text' name='tbColumn2'" & "value='" &
TestList(1,x) & "'" & ">"
Response.Write "</td>"
Response.Write "<td>"
Response.Write "<input type='text' name='tbColumn3'" & "value='" &
TestList(2,x) & "'" & ">"
Response.Write "</td>"
Response.Write "</tr>"
Next
Response.Write "</table>"
%>
</table>
</form>

Right now, I have the names defined as tbColumn1, tbColumn2, tbColumn3. Those same names will be created each time in the loop. What I want to do is create a new value for the input name, so I have a different name for each input tag.

I want to use a stored procedure to update the the database using the input fields when the form is submitted. I need a different name for each
input tag. So, I figure I need a variable for the input name, but I'm not
sure how to get that to work in the loop? Any ideas how to go about doing
that?

Thanks for any help.
-Dman100-
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On