thunderain
Programmer
I hope someone can help me with this. I asked before but i think i didn't give the right info.
I have this working, a site search opening a separate window for results, but I have to have results displayed opening up in the same window in a page with three frames (top, side, main). results need to be displayed in main section titled "main information". ( have also tried "maiininformation", one word without space) I hope i am giving you enough info.
This code works to open results page in separate window, (works fine)
form code:
<form action="javascript:void(0)" target="main information" onSubmit="search(this); return false;">
<td height="29" valign="top" bgcolor="#000000" width="118">
<div align="left">
<img src="images/search3.jpg" width="90" height="29" border="0"><input type="text" name="srchval" value="" size="10"> <input type="image" img src="images/gobutt.jpg" align="absmiddle" width="30" height="25" border="0"></div>
</td>
</form>
FUNTION:
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();
}
===============
I have tried several things. Is it as simple as changing a couple of lines, or do I need to send info to another page? Am I going at it wrong?
This is where i am now, but it does't return anything:
function search(frm) {
win = parent.frames["main information"].location;
win.document.write(page);
txt = frm.srchval.value.split(" "
;
ETC
OR
function search(frm) {
parent.frames["main information"].location;
document.write(page);
txt = frm.srchval.value.split(" "
;
ETC
Any help would be appreciated.
Thank you
thunderain.
I have this working, a site search opening a separate window for results, but I have to have results displayed opening up in the same window in a page with three frames (top, side, main). results need to be displayed in main section titled "main information". ( have also tried "maiininformation", one word without space) I hope i am giving you enough info.
This code works to open results page in separate window, (works fine)
form code:
<form action="javascript:void(0)" target="main information" onSubmit="search(this); return false;">
<td height="29" valign="top" bgcolor="#000000" width="118">
<div align="left">
<img src="images/search3.jpg" width="90" height="29" border="0"><input type="text" name="srchval" value="" size="10"> <input type="image" img src="images/gobutt.jpg" align="absmiddle" width="30" height="25" border="0"></div>
</td>
</form>
FUNTION:
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();
}
===============
I have tried several things. Is it as simple as changing a couple of lines, or do I need to send info to another page? Am I going at it wrong?
This is where i am now, but it does't return anything:
function search(frm) {
win = parent.frames["main information"].location;
win.document.write(page);
txt = frm.srchval.value.split(" "
ETC
OR
function search(frm) {
parent.frames["main information"].location;
document.write(page);
txt = frm.srchval.value.split(" "
ETC
Any help would be appreciated.
Thank you
thunderain.