Aiii
10-28-2005, 11:06 AM
I'm a bit of a novice on asp and i'm having some trouble with the request.form command. I have to update a buckload of records at the same time. In the main page I have the following code:
<%
Dim MaatVRRS, MaatVRSQL
Set MaatVRRS = Server.CreateObject("ADODB.Recordset")
MaatVRSQL = "Select * From prijzen "_
&"WHERE productnr = 1 order by breedte, hoogte asc"
Call MaatVRRS.Open (MaatVRSQL, strCon)
Call MaatVRRS.Movefirst()
While not MaatVRRS.EOF
%>
<tr>
<td><font face="verdana" size="2" color="#000000"><center><b><%=MaatVRRS("breedte")%></b></center></font></td>
<td><font face="verdana" size="2" color="#000000"><center><b><%=MaatVRRS("hoogte")%></b></center></font</td>
<td><font face="verdana" size="2" color="#000000"><center><b><input type="text" value="<%=MaatVRRS("prijs")%>" name="<%=MaatVRRS("id")%>"></b></center></font></td>
</tr>
<% Call MaatVRRS.Movenext()
Wend %>
As you can see the name of the textbox is variable from the databases "id" column.
Now when I try to process (update) the information from the textboxes (once again using a while loop to go through the records) in my database I cannot seem to get the input text using the Request.Form command. In the loop in that page I'm trying to update the field prijs by requesting like this:
prijsid = MaatVRRS("id")
prijs = Request.Form("'"&prijsid&"'")
Problem is, this returns an empty field and not the value input in the textbox with that variable id.
Is it at all possible to use variable names from textboxes or is this a lost cause? Any help would be greatly apreciated.
TIA.
<%
Dim MaatVRRS, MaatVRSQL
Set MaatVRRS = Server.CreateObject("ADODB.Recordset")
MaatVRSQL = "Select * From prijzen "_
&"WHERE productnr = 1 order by breedte, hoogte asc"
Call MaatVRRS.Open (MaatVRSQL, strCon)
Call MaatVRRS.Movefirst()
While not MaatVRRS.EOF
%>
<tr>
<td><font face="verdana" size="2" color="#000000"><center><b><%=MaatVRRS("breedte")%></b></center></font></td>
<td><font face="verdana" size="2" color="#000000"><center><b><%=MaatVRRS("hoogte")%></b></center></font</td>
<td><font face="verdana" size="2" color="#000000"><center><b><input type="text" value="<%=MaatVRRS("prijs")%>" name="<%=MaatVRRS("id")%>"></b></center></font></td>
</tr>
<% Call MaatVRRS.Movenext()
Wend %>
As you can see the name of the textbox is variable from the databases "id" column.
Now when I try to process (update) the information from the textboxes (once again using a while loop to go through the records) in my database I cannot seem to get the input text using the Request.Form command. In the loop in that page I'm trying to update the field prijs by requesting like this:
prijsid = MaatVRRS("id")
prijs = Request.Form("'"&prijsid&"'")
Problem is, this returns an empty field and not the value input in the textbox with that variable id.
Is it at all possible to use variable names from textboxes or is this a lost cause? Any help would be greatly apreciated.
TIA.