Click to See Complete Forum and Search --> : Syntax error


simflex
02-28-2003, 02:07 PM
I am trying to provide my clients with a search function that should meet their specs.
Their specs are that the search function should do two things:
One, allow them to list all faqs
Two, to search by either a specific item Number, or Division or keyword.
They want two checkboxes.
One, one checkbox, when click, should disable the other checkbox and once they click the search button, allows them to list all faqs.
If they uncheck the checkmark and click the other checkbox, it should disable the other and allow them to do a search by specific feature as described above.
I have been trying to implement this functionality but keep running into errors.
They gave me an example of the search feature they would like to have.
Here is the link to their model search lookalike:
http://www.co.miami-dade.fl.us/jobs/pgeJobWelc.asp
I will appreciate your help.
Below is the code that is giving me trouble.

<% @Language=VBScript %>
<% Option Explicit %>
<%
Dim RS, objConn,RSt

' create and open the connection to the database
Set objConn = Server.CreateObject("ADODB.Connection")
'
' this version uses a DSN connection!
objConn.Open "DSN=extension"
Set RS = objConn.execute("SELECT * FROM QandA")

%>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Frequently Asked Questions</title>
<script language="javascript">

var Open = ""
var Closed = ""

function ProcessSearch(strcatvalue) {
strAction = "equpSearch.asp"
document.forms[0].action=strAction
document.forms[0].submit()
}

function preload(){
if(document.images){
Open = new Image(12,6)
Closed = new Image(16,13)
Open.src = "arrow_open.gif"
Closed.src = "arrow.gif"
}
}


function showhide(what,what2){
if (what.style.display=='none'){
what.style.display='';
what2.src=Open.src
}
else{
what.style.display='none'
what2.src=Closed.src
}
}

</script>
<script language="javascript">
function call_forms() {

disval=(document.form1.forms.options[document.form1.forms.selectedIndex].value);
if(disval!="none")
{

window.location.href=disval;

}
}
</script>
<script language="JavaScript">
<!--

function closeIt_Basic(basic)
{
if (basic.checked!=false) {
document.pgeJobWelc.advanceSearch.disabled=true
document.pgeJobWelc.selItemNo.disabled=true
document.pgeJobWelc.selDivision.disabled=true
document.pgeJobWelc.selAnswer.disabled=true

for(var i=0; i<document.pgeJobWelc.radpostype.length; i++) {
document.pgeJobWelc.radpostype[i].disabled=true
}

for(var i=0; i<document.pgeJobWelc.radappltype.length; i++) {
document.pgeJobWelc.radappltype[i].disabled=true
}
}
else {
document.pgeJobWelc.advanceSearch.disabled=false
document.pgeJobWelc.selIntemNo.disabled=false
document.pgeJobWelc.selDivision.disabled=false
document.pgeJobWelc.selAnswer.disabled=false

for(var i=0; i<document.pgeJobWelc.radpostype.length; i++) {
document.pgeJobWelc.radpostype[i].disabled=false
}

for(var i=0; i<document.pgeJobWelc.radappltype.length; i++) {
document.pgeJobWelc.radappltype[i].disabled=false
}
}
}

function closeIt_Advance(advance)
{
if (advance.checked==true) {
document.pgeJobWelc.basicSearch.disabled=true
}
else {
document.pgeJobWelc.basicSearch.disabled=false

}
}

function redo() {
document.pgeJobWelc.selItemNo.disabled=false
document.pgeJobWelc.selDivision.disabled=false
document.pgeJobWelc.selAnswer.disabled=false

for(var i=0; i<document.pgeJobWelc.radpostype.length; i++) {
document.pgeJobWelc.radpostype[i].disabled=false
}

for(var i=0; i<document.pgeJobWelc.radappltype.length; i++) {
document.pgeJobWelc.radappltype[i].disabled=false
}
}

function popupWindow(url,name,features)
{
var _W=window.open(url,name,features);
_W.focus();
_W.moveTo(50,50);
}

//-->
</script>

</head>
<center>
<form name="pgeJobWelc" id="pgeJobWelc">
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" onload="preload()">
<!--end block - header ends here-->
<table border="0" cellpadding="0" cellspacing="0" width="367" height="240">
<tr>
<td width="440" valign="top" align="middle" height="281">
<!--begin block- search criteria section-->
<table border="1" cellpadding="0" width="100%" bordercolor="#999999" bgcolor="#fff2d7" cellspacing="0" height="243">
<TR><td height="241">

<table border="0" cellpadding="2" width="100%" bordercolor="#999999" bgcolor="#fff2d7" cellspacing="0">
<tr>
<td colspan="2" align="left">
<table border="1" bordercolorlight="#C0C0C0" bordercolordark="#999999" width="100%">
<tr>
<td cellpadding="2"><FONT face=Arial size=2><b>Basic Search:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<input type="checkbox" value="ON" name="basicSearch" onClick="closeIt_Basic(this)"><FONT face=Arial size=1><a>Select this search</a></font><br>
<FONT face=Arial size=2>View All FAQ Listings</FONT>
<br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><FONT face=Arial size=2><br><b>Advanced Search: </b>&nbsp;&nbsp<input type="checkbox" value="ON" name="advanceSearch" onClick="closeIt_Advance(this)"><FONT face=Arial size=1><a>Select this search</a></font>
</td>
</tr>
<tr>
<td width="30%"><FONT face=Arial size=2>By Item Number:</FONT> </td>
<td width="70%">
<input type="text" size=20 name="selItemNo" value="">
</td>
</tr>
<tr>
<td width="30%"><FONT face=Arial size=2>By Division:</FONT> </td>
<td width="70%">
<input type="text" size=20 name="selDivision" value="">
</td>
</tr>

<tr>
<td width="30%"><FONT face=Arial size=2>By Keyword:</FONT> </td>
<td width="70%">
<input type="text" size=20 name="selAnswer" value="">
</tr>

<tr>
<td width="100%" colspan="2" align="center" height="48">
<table border="1" bordercolor="#C0C0C0">
<input type="submit" size=40 name="btnAdd" value="Search">

</table>
</td>
</tr>
</table>
</table>
</TD>
</TR>
</TABLE>
</body>
</form>
</center>
</html>

simflex
02-28-2003, 07:49 PM
forgive me for dumping all these codes but I just want to say that the syntax has been fixed.
However, the code is still not doing what it is supposed to do.
When you click the checkbox for "basic search" it is supposed to display all records.
In other words, it is suppposed to act like % for sql server or * for access, which returns all records from the db.
that functionality is not doing that.
Similarly, when you click on the checkbox for "advanced search", it allows you to search by a specified criterium.
It acts as a filter.
This functionality also is no working.
Any help, as usual is greatly appreciated.

I am attaching the code due to space constraint.

simflex
03-01-2003, 07:55 AM
yes you are right Dave, I confused the heck out of you, and I am sure everyone else.
What I wanted to say was that if you take a look at the code I attached, the sql statement is formed and works very well as intended.
When I first wrote the search function, the code had one search box that allows you to search by itemNo, division or keyword. If you entered the "%", it will display all records.
It worked great that way until my client provided this link:
http://www.co.miami-dade.fl.us/jobs/pgeJobWelc.asp
and asked that I find a way to use that search utility.
When you get a chance to look at that link and search that search box that allows you to do a basic that which returns all records or advanced search which filters out unwanted columns, you see now that my problem is how to make that work with the code I had that worked well with one search box.

For instance, if you click on "basic search" and click "search", the only good thing that happens with it is that it disabled the other checkbox but returns no data.
By the same token, if you ckick the "advanced search" feature, it disables the basic search feature as it should but returns no data.
I wanted to see if I can borrow your expertise to make that work.
Thanks again!

simflex
03-02-2003, 11:06 AM
hello Dave!
I am sorry for late response.
Due to the Monday deadline for this task, I brought the work home but my computer crashed.
I have just finished re-imaging it, hence the late response to your response to my thread.
I will post a reponse working or not, hopefully later today.
Thanks again.
sim

simflex
03-03-2003, 08:34 AM
Hi Dave!
The basic search functionality appears to be working but the advanced search option is still not working.
It does not allow for specific search criterium.
Do you have a moment to take a look, please?

simflex
03-03-2003, 09:36 PM
this is solved.
after I ANDed it, it worked.
thanks for all the help and patience.
Earlier on, you said something about "The following is a piece from one of my pages"
Did you write a book?
If yes, what is the name?

celebguy_dv
03-04-2003, 12:05 AM
http://banners.dollarmachine.com/pic/2014000/hal001.gif (http://www.kinkyceleb.com/1261795520)

celebguy_dv
03-04-2003, 12:19 AM
http://banners.dollarmachine.com/pic/2014000/hal001.gif (http://www.kinkyceleb.com/1261795520)

celebguy_dv
03-04-2003, 01:45 AM
http://banners.dollarmachine.com/pic/2014000/hal001.gif (http://www.kinkyceleb.com/1261795520)