Ask a Question related to Dreamweaver AppDev, Design and Development.
-
*nvdb* #1
simple search option ???
I'd like to achieve the following:
one simple search form on my website (so only one textfield) where users could
put in one keyword, ie
the brandname, or the specific product or the kind of product and not having
to go thru the hassle filling three different textfield, etc (less is more).
So I thought doing the follwing:
- create a serach form
- create one textfield
- set action to GET
- resultpage with those columns out of the table (of my acces database),
and using the Request.String.
In the advanced dialogbox is set up the following WHERE Statement
SELECT *
FROM [Opvang Amsterdam]
WHERE Opvangnaam LIKE '%Zoektocht%' OR Opvangsoort LIKE '%Zoektocht1' OR
Instelling like '%Zoektocht2'
And in the parametergrid i defined zoektocht thru zoektocht2 all as Request
QueryString
It worked fine, that is it ONLY returns the results for " WHERE Opvangnaam
LIKE '%zoektocht%'
Of course i fiddled around, ie restricting to one variables (zoektocht) but
with the same result - none ...
Then I bought the dreamweaver extension of Tom Muck, beeautiful i think but I
have everything setup in Javascript and this only works in VB-script, so no use
either.
I thougth my wish was quiet simple, but i can't make it work, so if you have a
solution please help. Also I'd like to use ESCAPE function on the where clause,
to omit things like a or the: is that possible at all, or do i need to parse
and clean up the text-input ?
Thanks in advance, nina
Here's the code of the page:
..<%@LANGUAGE="JAVASCRIPT"%>
<!--#include file="Connections/aanbodmo.asp" -->
<%
var Recordset2__Zoektocht = "%";
if (String(Request.QueryString("zoekinst")) != "undefined" &&
String(Request.QueryString("zoekinst")) != "") {
Recordset2__Zoektocht = String(Request.QueryString("zoekinst"));
}
%>
<%
var Recordset2__Zoektocht1 = "%";
if (String(Request.QueryString("zoekinst")) != "undefined" &&
String(Request.QueryString("zoekinst")) != "") {
Recordset2__Zoektocht1 = String(Request.QueryString("zoekinst"));
}
%>
<%
var Recordset2__Zoektocht2 = "%";
if (String(Request.QueryString("zoekinst")) != "undefined" &&
String(Request.QueryString("zoekinst")) != "") {
Recordset2__Zoektocht2 = String(Request.QueryString("zoekinst"));
}
%>
<%
var Recordset2 = Server.CreateObject("ADODB.Recordset");
Recordset2.ActiveConnection = MM_aanbodmo_STRING;
Recordset2.Source = "SELECT * FROM [Opvang Amsterdam] WHERE Opvangnaam LIKE
'%"+ Recordset2__Zoektocht.replace(/'/g, "''") + "%' OR Opvangsoort LIKE '%"+
Recordset2__Zoektocht1.replace(/'/g, "''") + "' OR Instelling like '%"+
Recordset2__Zoektocht2.replace(/'/g, "''") + "' ";
Recordset2.CursorType = 0;
Recordset2.CursorLocation = 2;
Recordset2.LockType = 1;
Recordset2.Open();
var Recordset2_numRows = 0;
%>
<%
var Repeat1__numRows = 10;
var Repeat1__index = 0;
Recordset2_numRows += Repeat1__numRows;
%>:confused;
*nvdb* Guest
-
HELP! Question regarding a SIMPLE search!
I already posted this in the general discussion board but havent gotten a response: Alright guys, thanks in advance. I am fairly new to... -
Simple search extension
I notice that the Simple Search extension which I got for DMMX was uopdated for MX2004. Does anyone know if there is an update for DW8?:confused; -
Multiple search criteria with empty field option
Hi guys! I know I am being dumb here but running out of ideas. I am a newbie to php and mysql and progressing quite well. However, I am currently... -
create a simple search
Simple search... Can any one give me how to start a basic search in cf.? The directory I want to search through is on another server.. Any help... -
simple search
Please help i have dreamweaver mx and mysql,php4,apache. i need to make a search page that a person adds keywords and it searches 1 table with the...



Reply With Quote

