So I’m building this webpage that has a form built into a frame. Its ASP with VBScripting, FTR.
The frameset has two frames, one at the top and one at the bottom. The top frame is a form with drop downs and a submit button. The action for the for submission is the main frameset. When the form is submitted variables are passed to the frameset, then to the frames themselves. The top frame is reloaded and the bottom frame calls a Crystal report based on the variable passed in.
Here’s the problem. When I submit the form normally, it doesn’t want to refresh the page and the Crystal report isn’t called. When I submit the form but change the target to “_blank” to open a new window everything works grea. However I don’t want to be opening new windows, I want to reuse the same window. when I set the target to “_self” it does the same thing as without a target setting.
I’m thinking there’s probably some quick VB or Javascript solution to this that I just can’t think of. Any thoughts from the vast developer community here? Thanks.
From the MSDN library:
target property
Have you tried naming the bottom frame?
I’m not quite sure what you mean by “naming”. I’ll paste some code here if that helps.
Here’s the frameset (ITReportsFrameSet.asp):
<% @Language=VBScript %>
<!--#INCLUDE file="include/dbaccess.asp"-->
<%
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
ManagerName = Request.Form("ManagerName")
ReportPeriod = Request.Form("ReportPeriod")
Grouping = Request.Form("grouping")
MonthNum = Request.Form("MonthNum")
CrystalUrl = Report.rtp
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="140,100%" cols="*">
<frame src="ITReportsTopFrame.asp?submitted=true&ManagerName=<%=ManagerName%>&mth=<%=monthNum%>&ReportPeriod=<%=ReportPeriod%>&Grouping=<%=Grouping%>">
<frame src="<%=CrystalUrl%>">
</frameset>
</html>
<%
else
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="140,100%" cols="*">
<frame src="ITReportsTopFrame.asp">
<frame src="Blank.htm">
</frameset>
</html>
<%
end if
%>
Here’s the form (ITReportsTopFrame.asp):
<% @Language=VBScript %>
<!--#INCLUDE file="include/dbaccess.asp"-->
<html><!-- #BeginTemplate "/Templates/ITtemplateTopFrame.dwt" -->
<head>
<!-- #BeginEditable "doctitle" -->
<title>Individual Travel Reports</title>
<!-- #EndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#003366" link="#003366" vlink="#003366" alink="#CC0033">
<table width="100%" border="0" height="11%">
<td colspan="3" valign="top" align="left" height="72"><!-- #BeginEditable "Main%20Body" -->
<form name="LoadReport" method="POST" action="ITReportsFrameSet.asp" target="_blank">
<table width="100%" border="0">
<!--- Bunch of junk I edited out --->
<td height="100%">
<input type="submit" name="GetReports" value="Get Report">
</td>
<td width="25" height="100%"> </td>
</tr>
</table>
</form>
<!-- #EndEditable --> </td>
</tr>
</table>
</body>
<!-- #EndTemplate --></html>
As you can see, I do use the target property already. This version has it calling “_blank” which works fine, however it opens a new window. When I change that to “_self” the frames don’t do a full reload. Can I force it to do that somehow? Perhaps some javascrip or VB script in the frameset page the calls for a new version of the frames onLoad?
shrugs
From MSDN library:
NAME property
This associates a name with each frame.
Then from my earlier link, use “target = name” to tell the system where to open the report.
I’ll try it, but i’m not having trouble with where to open the report. Thats fine, it’s getting that destination to reload itself which seems to be the hang up.
Sorry, I guess I did not read the question properly.
Have you tried using the focus method? (But that only works after the element has finished loading.)
Please let me know what is the result of naming the target.
Well, I renamed the frames to no avail. The big thing here is that the target property is for where the form action loads. In this case the form calls the frameset, not the frame. Ergo, naming the frames is pretty pointless.
Also, the focus method isn’t relevant either since it applies to where the cursor goes and doesn’t affect the page load at all. Still struggling here.
I’m not sure I understand what’s going on (never having used either VBscript or ASP). But it looks like you’re trying to reload the entire frameset within the top frame (the POST target of _self is on the form in the top frame, right?). In this case your new bottom frame (the one you’re trying to fill with the reports) will be hidden underneath the old one, which doesn’t ever change. (You can check to see if this is what’s happening by changing your frameset row dimensions from “140,100%” to “50%,50%”; see if the top frame gets subdivided every time you post.)
It sounds like you want a POST target of _parent, to replace the enclosing frameset with the newly-reloaded frameset. Does that make sense, or am I misunderstanding what you’re trying to do?
Actually it looks like you nailed it. I figured it out on my own doing a little research and was just about pop in here and wrap it up saying problem solved. It was the “_parent” target which fixed it as a matter of fact. I was a little unclear as why that solved the issue once I figured it out, but it did. Reading your post I think I see why now. Thanks.