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

Reverse Cmd Button 1

Status
Not open for further replies.

juandiegomc

Programmer
Apr 25, 2003
60
0
0
US
Hello,

My web site is:



My first folder is and so I

use this code to return to it: [

document.URL='index.html' ].

Now I go to a "NEW" folder using this code:

onclick="document.URL='base1/english.html' and I go to the page, (right)


but now I want to return from file "base1/english.html back

to the first file
What is the code on the cmd button "Return" to go back to:

to the first file
juandiegomcc@afirmacion.com
 
Why not try pressing the "Back" button in your browser?

Seriously though, I think what you're looking for is a History GoBack function... used with JavaScript.

Here's the code.

Code:
<a href=&quot;javascript:history.go(-1)&quot;>
LINK TEXT GOES HERE
Code:
</a>

&quot;Hey...Where are all the chicks?&quot; -- unknown
 
xWastedMindx,

I owe you a star... it works super but can I make it like a button? Again, thank you very much.

juandiegomcc@afirmacion.com




 
Yup. use this code.

<form>
<input type=&quot;button&quot; value=&quot;Go Back&quot; onClick=&quot;javascript:history.go(-1)&quot;>
</form>

&quot;Hey...Where are all the chicks?&quot; -- unknown
 
I did forget to add.. this method is not Full Proof though. If the end user has JavaScript turned off, it will not work.

So then what you could do is just create a regular HREF link pointing back to the original page.

<a href=&quot;yoursite.com/index.html&quot;>go back</a>





&quot;Hey...Where are all the chicks?&quot; -- unknown
 
Hello xWastedMindx,

The dummy cmd button looks and works super. I must

say it works super. Again you deserve that big star.

juandiegomcc@afirmacion.com




























 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top