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>  <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>  <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>
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>  <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>  <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>