how do I remove frames

R

Ruskin

I have a frame_master.asp page, that creates two framesets. A horizontal
frameset (with two rows) and in the second row, a vertical frameset (with
two columns). The code is;

<frameset rows="155px,*">
<frame name="frame_header" src="frame_header.asp">
<frameset cols="25%,*">
<frame name="frame_index" src="frame_index.asp">
<frame name="frame_details" src="frame_details.asp">
</frameset>
</frameset>

This works fine, except it is called from a search page (search.asp). There
is a button in the frame_header.asp page that takes you back to search.asp,
but it only puts the search page into the top frame. How do I clear the
entire frameset, from the frame_header.asp page, so that search.asp takes up
the entire page?
 
J

Jeff Thies

This works fine, except it is called from a search page (search.asp). There
is a button in the frame_header.asp page that takes you back to search.asp,
but it only puts the search page into the top frame. How do I clear the
entire frameset, from the frame_header.asp page, so that search.asp takes up
the entire page?

Google is your friend. A search for taget and frames:

<URL:
http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=frame+target&btnG=Search
Yields this as it's first result:

<URL: http://www.w3.org/TR/REC-html40/types.html#h-6.16 >

Easy huh?

Jeff
 
R

Ruskin

Thanks Jeff,

I was using target="_top", in my frame_header.asp, but it was in a button,
eg;
<input type="button" value="Search" name="btn_search"
onclick="javascript:window.location='search.asp';" target="_top" />

This didn't work, as the button did not have a target, but the form did, I
changed the onclick to;
onclick="targetSubmit();"

And then wrote the targetSubmit function;
function resetTargetSubmit() {
document.frm_header.method = "post";
document.frm_header.action = "search.asp";
document.frm_header.target = "_top";
document.frm_header.submit();
}

This works perfectly now...
 
J

Jeff Thies

Ruskin said:
Thanks Jeff,

I was using target="_top", in my frame_header.asp, but it was in a button,
eg;
<input type="button" value="Search" name="btn_search"
onclick="javascript:window.location='search.asp';" target="_top" />

This didn't work, as the button did not have a target, but the form did, I
changed the onclick to;
onclick="targetSubmit();"

It's usually best just to have a regular submit button so the form will
work if no javascript.

You can still have an onclick handler or:

<form target="_top" onsubmit="someJSFunction()" ...>

Cheers,
Jeff
 

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

Similar Threads


Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top