Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Directory Search

Status
Not open for further replies.

norstarboston

IS-IT--Management
Nov 20, 2002
110
US
Ok here is the situation.

I have a directory
Inside this directory there are hundreds of PDF files (1.pdf , 2.pdf , 3.pdf etc etc). I need a simple form that will open these pdf files when a user enters the file number into a form field. So if someone wanted to open "1.pdf" they would simply type in the number 1 and that in turn would launch Does that make sense? Can anyone help?

Thanks
 
Hi, norstarboston


to use this script you must place a button or link that will popup this window (with this code )

Code:
<HTML>
<HEAD>
<TITLE>PDF Search</TITLE>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--- Hide from tired old browsers that should be put to pasture.


function goForit() {
  var l;
  var p;
  p=this.document.testform.inputbox.value
  l=p + &quot;.pdf&quot;
  fetch(l)
  self.close()
}

function fetch(l) {
  var root;
  if (opener.closed) {
    

root=window.open('','thePDFgopher','toolbar=yes,location=yes,status=yes,menubar=yes,scro

llbars=yes,resizable=yes,copyhistory=no');
    root.location.href = location;
  } else {
    opener.location.href = l;
  }
}

// End hiding --->
</SCRIPT>

</HEAD>

<BODY>

<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR>
<TD ROWSPAN=2 WIDTH=50%>
  

<TD WIDTH=50% ALIGN=CENTER VALIGN=MIDDLE>



<TR>
<TD WIDTH=50% ALIGN=CENTER VALIGN=BOTTOM>
<CENTER>
<FORM NAME=&quot;testform&quot;>
<INPUT TYPE=&quot;text&quot; NAME=&quot;inputbox&quot; VALUE=&quot;&quot; size=20>
<INPUT TYPE=&quot;button&quot; NAME=&quot;button&quot; Value=&quot;Search&quot; onClick=&quot;goForit(this.form)&quot;>




</FORM>
</CENTER>


</TABLE>

</BODY>

</HTML>

you can add whatever text with it but once the user clicks search it will bring up the search in the old window...This is not all HTML some is javascript...if you need any help with making a button or link to pop the window up or need help becuase the scripts not working just post back here.
hope the above helps
Jammer1221
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top