471,071 Members | 1,319 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,071 software developers and data experts.

post to iframe

Hi,

Just wondering how (or if it's possible) to post from my
page to another .asp page within an iframe? Hopefully
that question make sense? I know how to launch load a
page with an iframe, but how do I post to a page within a
page? Thanks, Doug

Jul 19 '05 #1
7 26841
If you want to make a link load something in an iframe use:

<a href="page.html" target="myframe">Click here</a>
(Where myframe is the name of the iframe)

if you have a link inside the iframe that you want to load the next page in
the iframe too, just leave out the target="" part

Gram

"doug" <do******@adelphia.net> wrote in message
news:00****************************@phx.gbl...
Hi,

Just wondering how (or if it's possible) to post from my
page to another .asp page within an iframe? Hopefully
that question make sense? I know how to launch load a
page with an iframe, but how do I post to a page within a
page? Thanks, Doug

Jul 19 '05 #2
OK ... how would I post a form to an iframe? - doug
-----Original Message-----
If you want to make a link load something in an iframe use:
<a href="page.html" target="myframe">Click here</a>
(Where myframe is the name of the iframe)

if you have a link inside the iframe that you want to load the next page inthe iframe too, just leave out the target="" part

Gram


Jul 19 '05 #3
Set the target of the form to the name of the iframe I believe will work.

"doug" <do******@adelphia.net> wrote in message
news:1a****************************@phx.gbl...
OK ... how would I post a form to an iframe? - doug
-----Original Message-----
If you want to make a link load something in an iframe use:
<a href="page.html" target="myframe">Click here</a>
(Where myframe is the name of the iframe)

if you have a link inside the iframe that you want to load the next page inthe iframe too, just leave out the target="" part

Gram

Jul 19 '05 #4
Thanks for the suggestions ... is anyone willing to submit
a brief code sample. What happens when I try is that
either, the form submits to a new window ... i.e. not in
my iframe ... or the iframe loads without my form's data
being passed to it. I guess another way of saying this is
that the iframe loads, but my form does not submit.

The way I was submitted prior to attempting the iframe
approach was this way:
Function submitme()
newwin = window.open _
("","myNewWin2","width=500,height=300,toolbar=0,sc rollbars=
1,resizeable=0,titlebar=0,menubar=0,status=1")
window.setTimeout "document.frm1.submit()",500
End Function

This works, however, since my confirmation of a successful
submission is just a few lines of text, I would like to
display the whole thing one page. Thanks for the help.

- doug
-----Original Message-----
Set the target of the form to the name of the iframe I believe will work.
"doug" <do******@adelphia.net> wrote in message
news:1a****************************@phx.gbl...
OK ... how would I post a form to an iframe? - doug
-----Original Message-----
If you want to make a link load something in an iframe

use:

<a href="page.html" target="myframe">Click here</a>
(Where myframe is the name of the iframe)

if you have a link inside the iframe that you want to

load the next page in
the iframe too, just leave out the target="" part

Gram

.

Jul 19 '05 #5
I haven't tried this, but I think it should work....

<form action="page_you_want_to_post_to.asp" method=post
target=your_iframe_name>
Jul 19 '05 #6
mtr26
1
Everyone's responses are correct. Here is a sample.

Contents of theForm.php
Expand|Select|Wrap|Line Numbers
  1. <!-- the iframe -->
  2. <iframe src='formHandler.php' frameborder="0"  name="theIFrame" />
  3.  
  4. <!-- form posting to iframe -->
  5. <form method='post' action='formHandler.php' target='theIFrame'>
  6. <input type='text' value='Random text'>
  7. <input type='submit'>
  8. </form>
  9.  
  10.  
Contents of formHandler.php
Expand|Select|Wrap|Line Numbers
  1. <!-- print out time and all the post vars -->
  2. <?
  3.     echo time() . "\n";
  4.     print_r($_POST);
  5. ?>
  6.  
I just realized this is an asp forum. But I'm sure you clever asp guys can translate the formHandler to somethin asp-ish.
Jun 23 '06 #7
I was wondering how a link could open an mp4 video in an iframe and specify its size.

Expand|Select|Wrap|Line Numbers
  1. <a href="file:///C|/Documents and Settings/Owner/My Documents/My Music/iTunes/iTunes Music/_Robot Chicken/Adult Swim/StarWars.mp4" target="_video">StarWars</a>
my iframe is called '_video'. Also, I don't know what the different tags for an iframe may be so my error may be there.
thanx
Jun 28 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Troy | last post: by
9 posts views Thread by Robin Becker | last post: by
7 posts views Thread by Christopher J. Hahn | last post: by
3 posts views Thread by Yourself | last post: by
1 post views Thread by Z1P2 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.