Guest_imported
New member
- Jan 1, 1970
- 0
I am displaying all sql records.
I have new_customer.asp file and edit_customer.asp
If user checks I want to send the user to edit_customer.asp,
if he submits without checking,
I want send user to add_customer.asp.
I coded like below. I am submitting page it self.
Some bugs are there. Help me with code. Thank you.
***************************************************
<!-- file name - submitHere.asp" -->
<%
set conn=Server.CreateObject("ADODB.Connection"
conn.open "dsn=northwind"
set rs = Server.CreateObject("ADODB.Recordset"
sql = "Select * from CUSTOMERS where country = 'USA' order by CUSTOMERID"
rs.Open sql, conn
%>
<%
Do Until rs.EOF %>
<form action="submitHere.asp" method="post">
<table border="1" cellpadding=0" cellspacing="0">
<tr>
<td width="30" align="center"><input type="radio" name="radioSelect" value='"<%= rs("CustomerID"
<td width="300"><%= rs("CompanyName"
</tr>
</table>
<%
rs.movenext
Loop
%>
<table>
<tr>
<td><input type="submit" name="Submit" value="submit"></td>
<td><input type="reset" name="reset" value="reset"></td>
</tr>
</table>
</form>
<%
Dim gotoSelection
gotoSelection = Request.form("radioSelect"
If gotoSelection = "1" Then
' If value is selected edit existing customer
Response.redirect "GOTO_EDITP.ASP"
Elseif gotoSelection = "0" Then
' If value is not checked go to add new a customer
Response.redirect "GOTO_ADD_NEW.ASP"
End if
%>
</body>
</html>
******************************************