Advanced Search Help Please........

wxdqz

New Member
I have a javascript I want to add to my site from javascriptsource. I have yet to add it to my site because I want to do more with it. I vaguely understand javascript and I have searched every where for a script to do what I want. This script comes the closest. The only thing is with this script, which is a search script allowing viewers to search my site, it is pretty basic. I would like to turn this basic search script into a more advanced search but I don't know how. I have tried to use the select and option value tags in there but it doesn't work for me. I am going to list the script below and I was wondering if someone can help me alter it to do these things:

I want a drop down menu that allows them to select the name brand watches I have.
I want a box that allows them to put in additional keywords
and I want a drop down menu that allows them to choose a price range starting at and ending at. Something like this example

CLICK HERE (<!-- m --><a class="postlink" href="http://www.watchwholesalers.com/showwatches.asp?brand=activa&sort1=discount&sortcd1=1&category=0&lowpercent=0&highpercent=100">http://www.watchwholesalers.com/showwat ... ercent=100</a><!-- m -->)

Now Here's The Code:-----
<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var item = new Array();

// "Page Name","path","Page Title","Many,Key,Words","Descriptive Comments

c=0; item[c]=new Array
("","activaladySV233-002.htm","Activa Lady Stainless Steel SV233-002","SV233-002,activa ladies watches,lady,37.50,stainless steel watches,black face,swiss quartz movement","Activa Ladies Watch, stainless steel case with swiss registry 49594...");
c++; item[c]=new Array
("","activaladySV235-005.htm","Activa Lady Stainless Steel SV235-005","SV233-005,lady,activa ladies watches,37.50,stainless steel watches,gold tone face,swiss quartz movement","Activa Ladies Watch, stainless steel case with swiss registry 49594...");
c++; item[c]=new Array
("","activaladySV235-006.htm","Activa Lady Gold Tone SV235-006","SV235-006,lady,activa ladies watches,37.50,stainless steel watches,black face,swiss quartz movement","Activa Ladies Watch, gold tone case with swiss registry 49594...");
c++; item[c]=new Array
("","activaladySB437403.htm","Activa Lady Two Tone Stainless Steel SB437-403","SB437-403,lady,activa ladies watches,37.50,stainless steel watches,gold tone face,swiss quartz movement","Activa Ladies Watch, two tone case with swiss registry 49594...");
c++; item[c]=new Array
("","activaladySB437404.htm","Activa Lady Two Tone Stainless Steel SB437-404","SB437-404,lady,activa ladies watches,37.50,stainless steel watches,white face,swiss quartz movement","Activa Ladies Watch, two tone case with swiss registry 49594...");
c++; item[c]=new Array
("","activaladySV233-100.htm","Activa Lady Stainless Steel SV233-100","SV233-100,lady,activa ladies watches,37.50,stainless steel watches,white face,swiss quartz movement","Activa Ladies Watch, stainless steel case with swiss registry 49594...");
c++; item[c]=new Array
("","activaladySV241-001.htm","Activa Lady Stainless Steel SV241-001","SV241-001,lady,activa ladies watches,37.50,stainless steel watches,swiss quartz movement","Activa Ladies Watch, stainless steel case with swiss registry 49594...");

page="<html><head><title>Search Results</title></head><body bgcolor='white'><center><table border=0 cellspacing=10 width=80%>";


function search(frm) {
win = window.open("","","scrollbars");
win.document.write(page);
txt = frm.srchval.value.split(" ");
fnd = new Array(); total=0;
for (i = 0; i < item.length; i++) {
fnd = 0; order = new Array(0, 4, 2, 3);
for (j = 0; j < order.length; j++)
for (k = 0; k < txt.length; k++)
if (item[order[j]].toLowerCase().indexOf(txt[k]) > -1 && txt[k] != "")
fnd += (j+1);
}
for (i = 0; i < fnd.length; i++) {
n = 0; w = -1;
for (j = 0;j < fnd.length; j++)
if (fnd[j] > n) { n = fnd[j]; w = j; };
if (w > -1) total += show(w, win, n);
fnd[w] = 0;
}
win.document.write("</table><br>Total found: "+total+"<br></body></html>");
win.document.close();
}
function show(which,wind,num) {
link = item[which][1] + item[which][0];
line = "<tr><td><a href='http://www.webdeveloper.com/forum/archive/index.php/"+link+"'>"+item[which][2]+"</a> Score: "+num+"<br>";
line += item[which][4] + "<br>"+link+"</td></tr>";
wind.document.write(line);
return 1;
}
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<center>

<form method=get action="javascript:void(0)" onsubmit="search(this); return false;">
<tr><td><input type=text name=srchval value=http://www.webdeveloper.com/forum/archive/index.php/""><input type=submit value="Search"></td></tr>
</form>

</center>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
----


I am not asking that someone code it for me but just tell me if I can use the select tags with this code and how I would go about doing it.

Thank you! I really appreciate it.
 
Back
Top