|
nettop -> RE: Search multiple fields from one entry (2/3/2007 14:55:43)
|
I'm trying to do the same multiple search on a new page and the using one field to search 3 fields is working fine (though I will be expanding it to search more fields in a bit). Currently, I'm having problems getting my form to 'yellow highlight' the words it finds on the search results page. Here is my current code. You can see the form at: http://www.paramountbusinessbrokers.com/admin/12_buyers_purchase_searchA1-3test.asp Try entering the word 'exec' and you'll see it return 2 records. I would like the letters 'exec' highlighted in yellow so the viewer can see their results. Please help, Thanks, Tim <%
Function Highlight(myString)
myFirst_Name = Request.Form("A1_Experience")
arrmyA1_Experience = Split(myA1_Experience, " ")
myOutput = myString
For i = 0 to Ubound(arrmyA1_Experience)
myOutput = Replace(myOutput, arrmyA1_Experience(i), "<span style='background-color:yellow'>"&arrmyA1_Experience(i)&"</span>",1,1,1)
Next
Response.write myOutput
End Function
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Buyers Purchase Questionairre</title>
<meta name="Microsoft Border" content="b">
</head>
<body>
<div align="center">
<p align="right"><a target="_top" href="default.asp">Return to Bret's Page</a></p>
<table border="0" width="100%">
<tr>
<td>
<div align="center">
<table border="0" width="801" cellspacing="0" bordercolor="#000000">
<tr>
<td align="center">
<!-- #include file="../_includes/menu_top1.inc" -->
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<p><b><span style="font-size: 11.0pt; font-family: Arial,sans-serif">Buyer
Information & Questionnaire</span></b></p>
<form BOTID="0" METHOD="POST" action="12_buyers_purchase_searchA1-3test.asp">
<input type="hidden" name="fpdbr_0_PagingMove" value=" |< ">
<table BORDER="0">
<tr>
<td><b>A1_Experience</b></td>
<td>
<input NAME="A1_Experience" VALUE="<%=Server.HtmlEncode(Request("A1_Experience"))%>" size="40"></td>
</table>
<br>
<input TYPE="Submit"><input TYPE="Reset"><input type="hidden" name="fpdbr_0_PagingMove" value=" |< "></form>
</form>
<table width="100%" border="1">
<thead>
<tr>
<th ALIGN="LEFT"><b>ID</b></th>
<th ALIGN="LEFT"><b>First_Name</b></th>
<th ALIGN="LEFT"><b>Last_Name</b></th>
<th ALIGN="LEFT"><b>Cell_Phone</b></th>
<th ALIGN="LEFT"><b>Day_Phone</b></th>
<th ALIGN="LEFT"><b>Email</b></th>
<th ALIGN="LEFT"><b>A1_Experience</b></th>
<th ALIGN="LEFT"><b>A2_Education</b></th>
<th ALIGN="LEFT"><b>A3_Occupation</b></th>
</tr>
</thead>
<tbody>
<!--#include file="../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Results WHERE (A1_Experience LIKE '%::A1_Experience::%' OR A2_Education LIKE '%::A1_Experience::%' OR A3_Occupation LIKE '%::A1_Experience::%') ORDER BY Timestamp DESC"
fp_sDefault="A1_Experience="
fp_sNoRecords="<tr><td colspan=9 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="12_buyers_info"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&First_Name=202&Last_Name=202&Address=202&City=202&State=202&Zip=202&Spouse_Name=202&Cell_Phone=202&Day_Phone=202&Email=202&A1_Experience=203&A2_Education=203&A3_Occupation=203&B1_Manufacturing_Related=202&B1_Service_Related=202&B1_Restaurants_FoodService=202&B1_Markets_GroceryStores=202&B1_Wholesale_Distribution=202&B1_Retail_Related=202&B1_Hotels_Motels_BBs=202&B1_Auto_Related_GasCarWashesAutoRepair=202&B1_Other=202&B1_Other_Details=202&B2_Purchase_Type=203&B3_Purchase_Not=203&B4_1Sacramento=202&B4_2_Roseville_Rocklin_Loomis=202&B4_3_Davis_Woodland=202&B4_4_RanchoCordova=202&B4_5_Folsom_ElDoradoHills=202&B4_6_Placerville=202&B4_7_Auburn=202&B4_8_GrassValley_NevadaCity=202&B4_9_Oroville=202&B4_10_ChicoArea=202&B4_11_Other=202&B5_Miles=202&B6_1_Working_Owner_Operator=202&B6_2_Absentee_Owner=202&B6_3_Strategic_Advisor=202&B7_Annual_Income=202&B8_Adjusted_Net_Income=202&B9_Timeframe=202&B10_Yes=202&B10_No=202&B10_Explain=203&B11_Why_Motivated_To_Buy_Now=203&C1_Yes=202&C1_No=202&C1_Other_Buyers_Roles=203&C2_Credit_Excellent=202&C2_Credit_VeryGood=202&C2_Credit_Good=202&C2_Credit_Poor=202&C3_Bankruptcy_Yes=202&C3_Bankruptcy_No=202&C4_Tax_Liens_or_Judgements_Yes=202&C4_Tax_Liens_or_Judgements_No=202&C4_Tax_Liens_or_Judgements_Filed=203&C5_How_Much_Cash_Down_Now=202&D1_Cash=202&D2_Stocks_Bonds_NonPension=202&D3_Stocks_Bonds_Pension=202&D4_Real_Estate_Personal=202&D5_Real_Estate_Other=202&D6_Value_Business_Owned=202&D7_Total_Assets=202&E1_Loans_Personal_Residence=202&E2_Loans_Other_Real_Estate=202&E3_Credit_Card_Liability=202&E4_Other_Revolving_Debt=202&E5_Total_Liabilities=202&E6_Net_Worth=202&F1_Employment_Salary=202&F2_Spouses_Employment_Salary=202&F3_Real_Estate_Income=202&F4_Other_Income=202&F5_Total_Annual_Income=202&G1_Date_Signed=202&G2_Signature=202&Remote_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&"
fp_iDisplayCols=9
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="../_fpclass/fpdbrgn1.inc"-->
<tr>
<td>
<%=FP_FieldVal(fp_rs,"ID")%></td>
<td>
<%=FP_FieldVal(fp_rs,"First_Name")%></td>
<td>
<%=FP_FieldVal(fp_rs,"Last_Name")%></td>
<td>
<%=FP_FieldVal(fp_rs,"Cell_Phone")%></td>
<td>
<%=FP_FieldVal(fp_rs,"Day_Phone")%></td>
<td>
<%=FP_FieldVal(fp_rs,"Email")%></td>
<td>
<%=Highlight(FP_FieldVal(fp_rs,"A1_Experience"))%></td>
<td>
<%=Highlight(FP_FieldVal(fp_rs,"A2_Education"))%></td>
<td>
<%=Highlight(FP_FieldVal(fp_rs,"A3_Occupation"))%></td>
</tr>
<!--#include file="../_fpclass/fpdbrgn2.inc"-->
</tbody>
</table>
</body>
</html>
|
|
|
|