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

iFrame question

Status
Not open for further replies.

Bob2

Programmer
Jul 3, 2000
228
SE
Hi


I wonder if and how I can submit form values on the main page (that holds an iFrame) to the iFrame itself?

If there are any that also knows how this is done in asp.net and vb.net - I would be happy to know that way to.



Regards
 
How about:
Code:
<form name="MyForm" action="script.aspx" target="MyIframe">
...
</form>

<iframe name="MyIframe" src="" width="300" height="300"></iframe>
 
Hi



I thought that was the way too, but when I submit the form values inside the iframe - nothing is displayed.

Any ideas?


/M
 

That is the way to do it - I've been coding a page all day that is doing that with much success.

Maybe the error doesn't lie with the functionality, but somewhere in the code of either source or target pages?

Hope this helps,
Dan
 
Hi


I use a simple
<%Response.Write Request.Form("MyValue")%>


But that doesn't give me anything..


Here is the pages I use

main.asp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>

</head>
<body>
<iframe id="pdfFrame" name="pdfFrame" style="position:absolute; width:200px; height:300px; top:36px; left:333px; z-index:1" frameborder="yes" scrolling="no" src="iframe.aspx">Your Browser doesn't support iFrame please upgrade</iframe>
<div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:2; left: 67px; top: 36px;">
<form action="iframe.asp" method="post" name="form1" target="pdfFrame">
<input name="MyValue" type="text" id="MyValue">
<br>
<br>
<input name="Button" type="button" value="Button">
</form>
</div>
</body>
</html>



iframe.asp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<%Response.Write ("value = " & request.form("MyValue"))%>
</body>
</html>


Regards


M
 
Hi


Sometimes its easy... Thanks a lot!


Regards


M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top