I have some web pages that are displayed in three frames
Top
Main
Bottom
In the top frame i have a form with a listbox and a submit button, when the user hits submit it refreshs the data in the main frame with data from a recordset. I also have a textfield ("txtPrint") which gets the data from the recordset and adds .pdf to the end so that it looks something like this
12345.pdf
I also have two submit buttons which when clicked go away and run script on the appropiate page to see if a file exists based on the value in the textfield, if it does then it returns the filename in the bottom frame if not then it returns "No File Exists".
If the file exists the user can then click the link and the PDF is opened in a new window.
My question is this :
Could I somehow add the code from the page which searches for the file to the end of the code from the main page so that after the user has selected from the listbox and submitted it will then display the data from the recordset and then search for the file and display the result in the mainframe. if this is possible then i could remove the bottom frame and display the PDF in the mainframe, as it is now I cannot do this because the mainframe is too small. Below is the code for my mainframe and also the code for my search page, the mainframe code is the source HTML.
Main Frame
Search Page
I did try adding the code to the end of the PrintCard code but it always returns "No File Exists" and i suppose that is because it is being run at the same time as the other code and therefore "txtPrint" does not have a value.
Any guidance on this would be much appreciated
Regards
Olly
Top
Main
Bottom
In the top frame i have a form with a listbox and a submit button, when the user hits submit it refreshs the data in the main frame with data from a recordset. I also have a textfield ("txtPrint") which gets the data from the recordset and adds .pdf to the end so that it looks something like this
12345.pdf
I also have two submit buttons which when clicked go away and run script on the appropiate page to see if a file exists based on the value in the textfield, if it does then it returns the filename in the bottom frame if not then it returns "No File Exists".
If the file exists the user can then click the link and the PDF is opened in a new window.
My question is this :
Could I somehow add the code from the page which searches for the file to the end of the code from the main page so that after the user has selected from the listbox and submitted it will then display the data from the recordset and then search for the file and display the result in the mainframe. if this is possible then i could remove the bottom frame and display the PDF in the mainframe, as it is now I cannot do this because the mainframe is too small. Below is the code for my mainframe and also the code for my search page, the mainframe code is the source HTML.
Main Frame
Code:
<html>
<head>
<title>PrintCard</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="tborders.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#037AF4">
<form action="" method="post" name="frmPrint" target="bottomFrame" id="frmPrint">
<table width="85%%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td height="23"><img src="../webbtl.gif" width="28" height="28"></td>
<td align="left" valign="middle"><input name="txtSprint" type="text" id="txtSprint3" style = "border-width: 0px;color:#FFFFFF" value="9636.pdf" size="10" maxlength="10">
</td>
<td align="left" valign="middle"><input name="SubmitPrint" type="submit" id="SubmitPrint5" onClick="frmPrint.action='FolderListPrint.asp'" value="Check Print PDF"></td>
<td align="left" valign="middle"> </td>
<td align="center" valign="middle"> </td>
<td colspan="2" align="center" valign="middle"><div align="left">
<input name="SubmitDraw" type="submit" id="SubmitDraw3" onClick="frmPrint.action='FolderListDraw.asp'" value="Check Drawing PDF">
</div></td>
<td> </td>
<td><img src="../webbtr.gif" width="28" height="28"></td>
</tr>
<tr>
<td width="5%" height="23"> </td>
<td class = "allCells" width="20%" rowspan="2"><img src="../GosportLogo.gif" width="180" height="44"></td>
<td class = "tbcells"colspan="5" rowspan="2" align="center" valign="middle"><font size="5" face="Verdana, Arial, Helvetica, sans-serif">PRINT
KEY DATA SHEET</font></td>
<td class = "lrtcells" width="21%"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">PRINT
No. </font></div></td>
<td width="5%"> </td>
</tr>
<tr>
<td> </td>
<td class = "lrbcells" rowspan="3"><div align="center"><font color="#FF0000" size="4" face="Verdana, Arial, Helvetica, sans-serif"><strong>1</strong></font></div></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class = "lrbcells" colspan="5"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">CUSTOMER
: <strong><font color="#0000FF" size="2">WHITMAN LABORATORIES LIMITED</font></strong></font><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
<td class ="bcells"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">SPEC
: <font color="#0000FF" size="2">
<input name="txtSpec" type="text" id="txtSpec" style = "border-width: 0px" value="9636" size="8" maxlength="8" >
</font></font></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class = "lrbcells" colspan="4"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">CUSTOMER
REF : <strong><font color="#0000FF" size="2">3206-01-0129</font></strong></font><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
<td colspan="2" class = "bcells"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">ID
SIZE : <font color="#0000FF" size="2"><strong>416 x 288 x 127</strong></font></font></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td > </td>
<td width="20%"> </td>
<td width="10%"> </td>
<td width="8%"> </td>
<td width="14%" > </td>
<td width="21%" > </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td colspan="2" class = "tlcells" ><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
</font><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
<font size="2">MACHINE DATA</font></font></div></td>
<td rowspan="6" bgcolor="#CCCCCC" class = "allcells"> </td>
<td class = "tbrcells" colspan="4"><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">INK
DATA </font></div></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class = "tlcells"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">BOARD
SIZE : <strong><font color="#0000FF" size="2">429</font></strong> X <font color="#0000FF" size="2"><strong>1455</strong></font></font></td>
<td class = "tlcells" ><font size="1" face="Verdana, Arial, Helvetica, sans-serif">
HAND HOLES : <font color="#0000FF" size="2"><strong>No</strong></font></font></td>
<td class = "brcells"><div align="center"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"> </font></div></td>
<td class = "brcells"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">INK
COLOUR </font></div></td>
<td class = "brcells"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">INK
CODE </font></div></td>
<td class = "brcells"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">STEREO
No </font></div></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class = "tlcells"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">GATE
SIZE : <font color="#0000FF" size="2"><strong>744</strong></font></font></td>
<td class = "tlcells" ><font size="1" face="Verdana, Arial, Helvetica, sans-serif">VENT
HOLES : <font color="#0000FF" size="2"><strong>No</strong></font></font></td>
<td class = "brcells"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">INK
1 :</font></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> Black</font></strong></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> HB 17105</font></strong></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> 1</font></strong></div></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class = "tlcells"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">CLEAN/TRIM
: <font color="#0000FF" size="2"><strong>Yes</strong></font></font></td>
<td class = "tlcells"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">ASTROFOIL
: <font color="#0000FF" size="2"><strong>No</strong></font></font></td>
<td class = "brcells"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">INK
2:</font></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></div></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class = "tlcells"> </td>
<td class = "tlcells"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">No
UP : <font color="#0000FF" size="2"><strong>1</strong></font></font></td>
<td class = "brcells"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">INK
3:</font></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></div></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td class = "tblcells"> </td>
<td class = "tblcells"> </td>
<td class = "brcells"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">INK
4:</font></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></div></td>
<td class = "brcells"><div align="center"><strong><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></strong></div></td>
<td> </td>
</tr>
<tr>
<td width="5%"> </td>
<td width="20%"> </td>
<td width="20%"> </td>
<td width="10%"> </td>
<td width="8%"> </td>
<td width="14%"> </td>
<td width="10%"> </td>
<td width="21%"> </td>
<td width="5%"> </td>
</tr>
<tr>
<td height="21"> </td>
<td class = "tlcells" colspan="2"><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">SPECIAL
INSTRUCTIONS / OPERATOR NOTES</font></div></td>
<td rowspan="2" bgcolor="#CCCCCC" class = "allcells"> </td>
<td colspan="4" class = "trcells"> </td>
<td> </td>
</tr>
<tr>
<td height="64"> </td>
<td class = "tblcells" colspan="2" valign="top"><font color="#0000FF" size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font></td>
<td class = "tbrCells" colspan="4"> </td>
<td> </td>
</tr>
<tr>
<td height="19"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><img src="../webbbl.gif" width="28" height="28"></td>
<td colspan="2"><div align="center"> </div></td>
<td> </td>
<td colspan="4"><div align="center"> </div></td>
<td><img src="../webbbr.gif" width="28" height="28"></td>
</tr>
</table>
</form>
</body>
</html>
Search Page
Code:
<title>Show Print</title>
<body bgcolor="#037AF4" link="#0000FF" vlink="#0000FF" alink="#FF0000">
<table cols="1" border="0" bgcolor="#00FFFF" align="center" cellpadding="4" cellspacing="4" style = "border-bottom: 1px solid blue; border-left: 1px solid blue; border-top: 1px solid blue; border-right: 1px solid blue">
<%
SearchValue = Request("txtSprint")
MatchesFound = False ' pessimistic boolean for match finds
'Create our FSO Object
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
'Stuff our folder into an object we can manipulate
Dim objFolder
Set objFolder = objFSO.GetFolder("C:\common\Key Print Data\Print cards")
Dim File, intCount
intCount = 0
For Each File in objFolder.Files
If (File.Name) = SearchValue Then
intCount = intCount + 1
If intCount = 1 Then
Response.Write "<tr>" & vbcrlf
End If
Response.Write "<td><a href=""\\ukgopsf002\common\Key Print Data\Print cards\" & File.Name & """ target=""new"">" & File.Name & "</a>" & "</td>"
If intCount = 1 Then
Response.Write "</tr>" & vbcrlf
intCount = 0
End If
MatchesFound = True ' something was matched.
End If
Next
If intCount > 0 Then
Do While intCount < 1
Response.Write "<td> </td>"
intCount = intCount + 1
Loop
Response.Write "</tr>" & vbcrlf
End If
If Not MatchesFound Then
Response.Write "<tr><td colspan='3'>No Print File</td></tr>" & vbcrlf
End If
%>
</table>
I did try adding the code to the end of the PrintCard code but it always returns "No File Exists" and i suppose that is because it is being run at the same time as the other code and therefore "txtPrint" does not have a value.
Any guidance on this would be much appreciated
Regards
Olly