
May 17th, 2012, 05:20 AM
|
|
Contributing User
|
|
Join Date: Feb 2005
Posts: 53
Time spent in forums: 19 h 35 m 11 sec
Reputation Power: 9
|
|
|
Search form and result on the same page
I am not very familiar with Ajax or Jquery. I have tried to put everything together in one page, and if you take a look at http://www.studio36.no/form20.asp , you will see the error just below the form. If you search for a organisation number like 940 060 192 you'll see the information below the form.
This is just what I want. I just need to get the initial error message out of the way and I have no idea on how to do that.
Here is the code from the page.
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<% option explicit %>
<%
Dim adOpenForwardOnly, adLockReadOnly, adCmdTable, adOpenStatic
adOpenForwardOnly = 0
adLockReadOnly = 1
adOpenStatic = 3
adCmdTable = 2
Dim objConn, objRS
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\home\studio36\www\Databaser\kunder.mdb;Persist Security Info=False"
'objConn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\inetpub\wwwroot\nina-saether\www\Databaser\kunder.mdb;Persist Security Info=False"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.open "kunder", objConn, adOpenStatic, adLockReadOnly, adCmdTable
Dim strSearch, strCriteria
strSearch = Trim(Replace(Request.Form("org"), "'", "''"))
strSearch = Request.Form("org")
strCriteria = "Org-nr='" & strSearch & "'"
'strCriteria = strSearch
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>bedriftsresevasjon</title>
</head>
<body>
<form id="search" name="search" method="post" action="form20.asp">
<p>
<label>
Org. nr.<br />
<input type="text" name="org" id="org" />
</label>
</p>
<p>
<label>
<input type="submit" name="Hent" id="Hent" value="Hent" />
</label>
</p>
</form>
<%
objRS.Find strCriteria
If objRS.EOF Then
Response.write "Det finnes ikke informasjon om dette org.nr." & strSearch
Else
Response.Write "<strong>Org. nr.:</strong>" & objRS("Org-nr") & "<br />" &_
"<strong>Navn:</strong>" & objRS("Navn") & "<br />" &_
"<strong>Tlf:</strong>" & objRS("Tlf") & "<br />" &_
"<strong>Mobil:</strong>" & objRS("Mobil") & "<br />" &_
"<strong>E-post:</strong>" & objRS("E-post") & "<br />"
End if
objRS.Close
objConn.Close
Set objRS = Nothing
Set objConn = Nothing
%>
</body>
</html>
If you could please tell med where I went wrong I would be really greatful.
|