ayha1999
asked on
Insert values from 10 textboxes with same name in asp
im using classic asp. i have an html form with 10 textboxes with same. can is use one statement to insert all these textbox values into the table.
eg.
Insert into table(name) values (txtbox1).
please help if any solution is available.
eg.
Insert into table(name) values (txtbox1).
please help if any solution is available.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can also reference the items like so:
request.form("text1")(1)
request.form("text1")(2)
request.form("text1")(3)
this will reference each text box in order from 1 to 10 whan they are all named text1
request.form("text1")(1)
request.form("text1")(2)
request.form("text1")(3)
this will reference each text box in order from 1 to 10 whan they are all named text1
Why a "C"?
The following example can help you....
<form method=get>
<input type=text name=var1 value=hello1>
<input type=text name=var1 value=hello2>
<input type=text name=var1 value=hello3>
<input type='submit'>
</form>
<%
qstr = Request("var1")
Response.write "str = " & qstr & " <br/>"
MyArray = split(qstr,",")
' Do database connectins here
For i=0 to Ubound(MyArray)
Response.write MyArray(i) & "<br>"
'query = "Insert into table(attrname) value(" & MyArray(i) &")"
Next
%>