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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the for next loop of vbscript 1

Status
Not open for further replies.

mikehrub

Technical User
Sep 6, 2000
7
US
Using the for next loop of vbscript I want to choose a textbox on the form. Example I have 3 textboxes each named textbox1 textbox2 textbox3 I want to assign values to each textbox using the for x =1 to 3 for the number and textbox as the value the following example is not correct but shows what I am looking to do
for x = 1 to 3
textbox & x = x
next
what is the proper syntax for this operation
 
Try this as an ASP page "Boxes.asp". Is this what you're looking for?

FengShui1998

<html>
<head>
<title>Boxes</title>
</head>
<body>
<%
qt = chr(34)
For I = 1 to 3
boxname = &quot;Textbox&quot; & Cstr(I)
strBox = &quot;<P><INPUT TYPE=&quot; & qt & &quot;TEXT&quot; & qt & _
&quot; NAME=&quot; & qt & boxname & qt & _
&quot; VALUE=&quot; & qt & I & qt & &quot;></p>&quot;
response.write strbox
Next
%>

</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top