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

Read and Write to a hidden frame

Status
Not open for further replies.

nkamp

Programmer
Joined
Jan 19, 2004
Messages
35
Location
NL
Hello,

I have made a hidden frame. Now I want to write to write and read data from the hidden frame. How To?
HTML code
<frame name="Main" scrolling="NO" src="login.asp?dt=<%=now%>">
<frame name="hiddenframe" frameborder="0" scrolling="No" src="hiddenframe.asp" >
End HTML code

hiddenframe.asp
<html>
<script>
<!--
var numberOfProducts=4;
alert(parent.hiddenframe.numberOfProducts);
alert(window.frames.length)
//-->
</script>
<body>
<INPUT TYPE="TEXT" NAME="myTextField" value"=5" >
</body>
</html>

And now in a different asp file I want to achieve the hiddenframe from the main frame which is filled with from a different asp file TT_Trace.asp file.

.Write "function drawCart()" & vbCrLf
.Write "{" & vbCrLf
.Write " parent.hiddenFrame.myTextField = 10;" & vbCrLf
.Write " alert(parent.hiddenFrame.myTextField);" & vbCrLf
.Write "}" & vbCrLf

Question:
- Must I first define a form on the hiddenframe?
- With the TT_Trace can I write new input text objects?

On this moment this I get the error "parent.hiddenframe is null or not a object"

Can anybody help me?

Thanks in Advance.

Nico
 
I have put this line in the submit function:
.Write "function submitThisWindow(knop)" & vbCrLf
.Write "{" & vbCrLf
.Write " if (checkFormData(document.frmFormulier) == true)" & vbCrLf
.Write " {" & vbCrLf
.Write " alert(top.frames['hiddenFrame']['numberOfProducts']);" & vbCrLf
.Write " document.frmFormulier.knop.value = knop;" & vbCrLf
.Write " document.frmFormulier.target = 'frm_uitvoeren';" & vbCrLf
.Write " document.frmFormulier.action = 'func_TT_intSelectie_count.asp';" & vbCrLf
.Write " document.frmFormulier.submit();" & vbCrLf
.Write " }" & vbCrLf
.Write " else" & vbCrLf
.Write " {" & vbCrLf
.Write " return false;" & vbCrLf
.Write " }" & vbCrLf
.Write "}" & vbCrLf

I get the same error.
 
Here is the rendered code of the browser:

HTML code:
function submitThisWindow(knop)
{
if (checkFormData(document.frmFormulier) == true)
{
alert(top.frames['hiddenFrame']['numberOfProducts']);
document.frmFormulier.knop.value = knop;
document.frmFormulier.target = 'frm_uitvoeren';
document.frmFormulier.action = 'func_TT_intSelectie_count.asp';
document.frmFormulier.submit();
}
else
{
return false;
}
}
End HTML code

Nico
 
Hello,

I have solved the problem with a hiddenframe. This is working perfectly.

Thanks anyway

Nico
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top