| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Just a little script I wrote for an aspfree user, currently set to work without a database but move a few comment indicators and your good to go!
Code:
<html>
<title>Give Dr_Rock lots of rep</title>
<body bgcolor="#FFFFFF">
<%
Dim strSQL, strVariableValue, bulFirstEntry, intCounter
If Request("submit") <> "" Then
bulFirstEntry = true
strSQL = "Update this_table Set this_field = desired_value where"
for each variable_name in request.form
If request.form(variable_name) = "1" then
'strip "select" and leaves us with the db row unique id
variable_value=Replace(variable_name , "select", "")
if bulFirstEntry then
strSQL = strSQL & " id =" & variable_value
bulFirstEntry = false
else
strSQL = strSQL & " or id =" & variable_value & " "
end if
End If
next
response.write(strSQL)
Else
response.write("no good")
End If
%>
<form action="<%= request.servervariables("script_name") %>" method="post">
<%
'Do Until rs.EOF
for intCounter=1 to 10
%>
<input type="checkbox" name="select<% Response.write(intCounter) 'rs("id") %>" value="1">Row <% Response.write(intCounter) 'rs("id") %><br>
<%
next
' rs.MoveNext
'Loop
%>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
|
|
#2
|
||||
|
||||
|
thanks, but this belongs in the code bank.
__________________
jmurrayhead Did I help you out? Make me popular by clicking the icon!New Members:Proper way to post a question Powered by ASP.Net |
|
#3
|
||||
|
||||
|
Moved to Code Bank
__________________
-
thought-after | my thoughts on web development Get Firefox, the developers browser Budget hosting - recommended [/left] |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Update database via dynamically created form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|