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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with <iframe> to process data

Status
Not open for further replies.

scc

Programmer
Apr 30, 2001
218
US
I have created (and condensed) these two pages, but obviously I'm doing something wrong. The SamplePage2.asp does not close and pass back the data to the SamplePage1. This is my first time using <iframe> tags.

Here's the code for SamplePage1:

<% @ Language =&quot;VBScript&quot; %>
<% Option Explicit %>
<%
Response.Expires = 0
Response.Buffer=True

'Filename: SamplePage1.asp
%>

<html>

<body>


<iframe name=hiddenIframe&quot; src=&quot;SamplePage2.asp&quot;
width = &quot;0&quot; height = &quot;0&quot;>
</iframe>
<table width=&quot;640&quot; align=&quot;center&quot; cellpadding=&quot;1&quot; border=&quot;1&quot;>
<form name='ClaimsView' action=SamplePage2.asp
target=&quot;hiddenIframe&quot;>

<tr>
<td align=&quot;right&quot;>
Visits Approved:
</td>

<td align=&quot;center&quot; width=&quot;100&quot;>
10
<input type=&quot;hidden&quot; name=&quot;Visits&quot; value=&quot;10&quot; >
</td>
<td align=&quot;right&quot;>
Remaining:
</td>
<td align=&quot;center&quot; class=&quot;tdbold&quot;>
<input type=&quot;text&quot; name=&quot;Remaining&quot; value=&quot;3&quot; size=&quot;5&quot; >
</td>
<td align=&quot;right&quot; class=&quot;emphasize&quot;>
+/- Visits:
</td>
<td>
<input type=&quot;text&quot; name=&quot;AdjustVisits&quot; size=&quot;5&quot; value=&quot;&quot; >
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;+&quot; >
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;-&quot; >
</td>
</tr>
</form>
</table>

</body>
</html>


And the code for SamplePage2:

<% @ Language =&quot;VBScript&quot; %>
<% Option Explicit %>
<%

'Filename: SamplePage2

Dim iReferralNum
Dim iVisits
Dim iAdjustVisits
Dim iAdjustment
Dim iVisitsRemaining

iVisits = Request(&quot;Visits&quot;)

iAdjustVisits = Request(&quot;AdjustVisits&quot;)

If Request(&quot;Submit&quot;) = &quot;+&quot; then
iAdjustment = iAdjustVisits

ElseIf Request(&quot;Submit&quot;) = &quot;-&quot; then
iAdjustment = - iAdjustVisits
End If

iVisitsRemaining = iVisits + iAdjustment

%>


<html>
<head>
<script language=&quot;javaScript&quot;>
<!--

function sendBack()
{
parent.document.ClaimsView.Remaining = (&quot;<%= iVisitsRemaining %> & &quot;);
parent.document.ClaimsView.AdjustVisits = &quot;&quot;;
}
//-->
</script>

</head>

<body onLoad=&quot;sendBack();&quot;>

</body>
</html>


Another set of eyes would be GREATLY appreciated.

TIA
 
sample2:
<% @ Language =&quot;VBScript&quot; %>
<% Option Explicit %>
<%

'Filename: SamplePage2

Dim iReferralNum
Dim iVisits
Dim iAdjustVisits
Dim iAdjustment
Dim iVisitsRemaining

iVisits = cint(Request(&quot;Visits&quot;))

iAdjustVisits = cint(Request(&quot;AdjustVisits&quot;))

If Request(&quot;Submit&quot;) = &quot;+&quot; then
iAdjustment = iAdjustVisits

ElseIf Request(&quot;Submit&quot;) = &quot;-&quot; then
iAdjustment = - iAdjustVisits
End If

iVisitsRemaining = cint(iVisits) + cint(iAdjustment)

%>


<html>
<head>
<script language=&quot;javaScript&quot;>
<!--

function sendBack()
{
try{
parent.document.ClaimsView.Remaining.value = (&quot;<%= iVisitsRemaining%>&quot;);
parent.document.ClaimsView.AdjustVisits = &quot;&quot;;
}catch(e){
sendBack;
}
}
//-->
</script>

</head>

<body onLoad=&quot;sendBack();&quot;>

</body>
</html>


sample1:
<% @ Language =&quot;VBScript&quot; %>
<% Option Explicit %>
<%
Response.Expires = 0
Response.Buffer=True

'Filename: SamplePage1.asp
%>

<html>

<body>


<iframe name=&quot;hiddenIframe&quot; id=&quot;hiddenIframe&quot; src=&quot;SamplePage2.asp&quot;
width = &quot;600&quot; height = &quot;200&quot;>
</iframe>
<table width=&quot;640&quot; align=&quot;center&quot; cellpadding=&quot;1&quot; border=&quot;1&quot;>
<form name='ClaimsView' action=SamplePage2.asp
target=&quot;hiddenIframe&quot;>

<tr>
<td align=&quot;right&quot;>
Visits Approved:
</td>

<td align=&quot;center&quot; width=&quot;100&quot;>
10
<input type=&quot;hidden&quot; name=&quot;Visits&quot; value=&quot;10&quot; >
</td>
<td align=&quot;right&quot;>
Remaining:
</td>
<td align=&quot;center&quot; class=&quot;tdbold&quot;>
<input type=&quot;text&quot; name=&quot;Remaining&quot; value=&quot;3&quot; size=&quot;5&quot; >
</td>
<td align=&quot;right&quot; class=&quot;emphasize&quot;>
+/- Visits:
</td>
<td>
<input type=&quot;text&quot; name=&quot;AdjustVisits&quot; size=&quot;5&quot; value=&quot;&quot; >
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;+&quot; >
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;-&quot; >
</td>
</tr>
</form>
</table>

</body>
</html>


 
Thanks for responding.

I copied and pasted the above code in but it does not change the values on my SamplePage1.asp???

 
First of all you can now see the iframe, does it show you an error?
Did you fill in a value next to the Visits:?
Did you click + or -.
I cannot tell you what your code is supposed to do but there were some errors in your code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top