iframe - submit form and open a new page

D

Dario Zuffi

Hello,

I have a form embedded in a webpage with iframe.
When I submit that form I get the result in the same iframe.

But...
I want to submit that form and display the result with "target=top" (a
full page with the result). How can I do that?

Thanks a lot for your help!

Dario
 
R

rf

Dario Zuffi wrote
Hello,
G'day.

I have a form embedded in a webpage with iframe.

Oh dear.
When I submit that form I get the result in the same iframe.

But...
I want to submit that form and display the result with "target=top" (a
full page with the result). How can I do that?

You would use target="_top".
 
K

Karl Core

Dario Zuffi said:
Hello,

I have a form embedded in a webpage with iframe.
When I submit that form I get the result in the same iframe.

But...
I want to submit that form and display the result with "target=top" (a
full page with the result). How can I do that?

Thanks a lot for your help!

Dario

If you had gone and reviewed the HTML spec from the W3C, you'd know that
'target' is a valid attribute for HTML 4.01
http://www.w3.org/TR/html401/index/attributes.html


-Karl
 
R

rf

If you had gone and reviewed the HTML spec from the W3C, you'd know that
'target' is a valid attribute for HTML 4.01

This is very true. taget *is* a valid attribute. For transitional that is.
 
S

Steve Pugh

I have a form embedded in a webpage with iframe.
When I submit that form I get the result in the same iframe.

But...
I want to submit that form and display the result with "target=top" (a
full page with the result). How can I do that?

<form action="foo" target="_top">

Note that target="top" creates a new window called top, whilst
target="_top" uses the full existing window, replacing all framesets.

I believe that some browsers have problems with target and iframes so
check carefully in a range of browsers. Personally I would never put
anything important (like a form) in an iframe.

Steve
 
N

Neal

And <spit type="disdainful">frameset</spit>.


All transitional - and strict - markup is valid in frameset.

Then again, playing runmmy and cross-stitching are allowed in prison. Go
figure.
 
R

rf

Neal did slutter:
You forgot the r. R stands for 'rum and coke'...

Er, that'd be rum&coke but you are learning m'boy :)

How did the martini party end up? Lois come?
 
R

rf

Neal misquoted:
All transitional - and strict - markup is valid in frameset.

Er, no. The only things allowed in frameset are frame related things.

Hint: validate your favourite non-frame page to frameset. You will find that
the <body> element is invalid :)
 
M

Mark Parnell

Er, no. The only things allowed in frameset are frame related things.

I was talking about the frameset DTD, not the <frameset> element. and
since Neal was replying to me, I assume he was too.
 
N

Neal

Neal did slutter:

Er, that'd be rum&coke but you are learning m'boy :)

All the same after a few.
How did the martini party end up? Lois come?

Can only wish. But I'm a reluctant dog. And my girl's got amazing...
attributes...

Let's just say pixels are not an appropriate measurement...
 
R

rf

Neal parried:
See http://www.w3.org/TR/html401/struct/global.html#h-7.2 :

"The HTML 4.01 Frameset DTD includes everything in the transitional DTD
plus frames as well."

Yeah well either the documentation is <horror> wrong </horror> or somebody
should tell them that their validator is broken.

Given the cloudy and sometimes misleading nature of the documentation I
would prefer to believe the validator, although that too has its problems.

I wonder what the other validators (non w3c) think? I *know* what the dtd
says: no <body> element. It has been replaced by the <frameset> element.
View the dtd here:
view-source:http://www.w3.org/TR/html4/frameset.dtd
Then again even the comments in there are a bit suss :)

For your enjoyment validate
http://users.bigpond.net.au/rf/tab.html
result:
<http://validator.w3.org/check?uri=http://users.bigpond.net.au/rf/
tab.html>
Validates to strict.

Now validate
http://users.bigpond.net.au/rf/tabframeset.html
result:
<http://validator.w3.org/check?uri=http://users.bigpond.net.au/rf/
tabframeset.html>
Objects to the <body> element.

View source and <grin>verify</grin> that the only thing that is different is
the doctype, specifying the strict or the frameset.dtd.
 
R

rf

Mark Parnell
I was talking about the frameset DTD, not the <frameset> element. and
since Neal was replying to me, I assume he was too.

I too am talking about the frameset DTD. See my reply to Neal. The frameset
DTD does *not* validate a <body> element in the document.
 
S

Steve Pugh

Mark Parnell

I too am talking about the frameset DTD. See my reply to Neal. The
frameset
DTD does *not* validate a <body> element in the document.

Yes it does. It just needs to be inside a <noframes> element which in turn
needs to be inside a <frameset> element.

Apart from the addition of the frame related elements and slight change to
the content models to accomodate them the Frameset DTD is identical to the
Transitional DTD. So (with the body correctly nested as outlined above)
anything valid in Transitional is valid in Frameset. So the target
attribute is valid in Frameset - though rather useless for the obvious
reasons.

Steve
 
R

rf

Steve said:
Yes it does. It just needs to be inside a <noframes> element which in turn
needs to be inside a <frameset> element.

Damn. A good point.

I overlooked this as I have never actually coded a <noframes> element.

I probably need to stand corrected :-(

Oh well, shit happens.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top