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!

navigating frames with back image button

Status
Not open for further replies.

hablablow

Programmer
Sep 9, 2000
115
FR
i have a document with 2 frames named control and main
First question:
In control i have a back image button. When onclick this button the 2
frames should go history -1. Here's my code:
</SCRIPT>
<script language=&quot;JavaScript&quot;>
<!--
function gum()
{
parent.control.history.go(-1);
parent.main.history.go(-1);
}
//-->
</script>
<TD ALIGN=&quot;LEFT&quot;><A HREF=&quot;#&quot; onClick=&quot;gum()&quot; ....

And of course it doesn't work.
Second question: I have also a clear form image button in control that should clear
all the forms in the other frame main. I don't know yhe proper syntax to do this.

If anyone knows.
Thanks for your incomming answers.
 
-> which browser are you targetting ?
-> try to alert(parent.control.history) for instance - do you get &quot;undefined&quot; ?
-> (just wondering, don't mind for this, everyone here seems to use <a href=# onclick=javascript ...> when there are many many many other ways not implying LINKS - for example <span onclick=javascript...> is the same, except that you don't end up with links that look like links but are not actual links)
-> to clear the form on say, main frame, supposing you're targetting ie4+ and your form name is formname : top.main.document.formname.reset() does the trick
 
Iza thanks for ur answers ( for yesterdays questions too )
With the back button stuff in frames i am targeting Ie and netscape 4+ versions.
I removed the script tags above my document and kept only in the body:
A HREF=&quot;#&quot;
ONCLICK=&quot;parent.history.back()&quot;....
This action works perfectly in Ie it reloads back both frames
Nothing happens in Netscape, and that is my problem.
Do you know a proper syntax for Netscape ?
Thanks for your incomming answer.
 
did you try the &quot;alert&quot; in netscape ? is it saying it finds the frame ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top