|
|
|
|
|
| | |
|
Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Re: Searching databases using HTML forms... |
From: |
Afolabi Arowolo |
Date: |
10/2/2000 7:09:34 PM |
IP: |
195.92.67.67 |
Hello their I had to implement something similar to what you,re trying to achieve. You can achieve what you want without submitting to 2 pages. Try this. you have a page called one.asp
<%name = request.form("name")
set rs = server.createobject("adodb.recordset")
sql = "select name from database where name = " &name& ""
rs.open sql, con
%>
<%
name = rs("name")
%>
<html>
<head>
<title>displaying results on one page</title>
</head>
<body>
<form action = "one.asp" method ="post">
<table>
<tr>
<td><input type= "textbox" name="name" value="<%=name%>"></td>
</tr>
<tr>
<td><input type="submit" value="send"></td>
</tr>
</table>
</form>
<%rs.close
set rs = nothing
con.close
set con = nothing
%>
As you can see from the above code the page submits to itself, it queries the database, passes the information to the variable called name which is then inserted into the value field of the textbox. I hope I,ve helped, email me back please as this is my first correspondence to a forum question. Cheers. p.s I presume you are using an include file for your connection string
|
Previous Message
|
|

|
|
|
|
|
|
|
|
|
|