Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FP2000: How to Create a "Back" Button on a Web Page Using Custom HTML


View products that this article applies to.

Summary

This article provides sample HTML code that inserts a command button, or a hyperlink, on a Web page that will return you to the previous document when you click the link or button.

↑ Back to the top


More information

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. The following HTML code adds a command button to a Web page form:

HTML Code That Uses VBScript:

<FORM method="POST" name="VBScript_Nav_Sample">
<INPUT TYPE="button" NAME="Go Back!" VALUE="VBScript_Backup_Sample" LANGUAGE="VBScript" OnClick="call window.history.back(1)">
</FORM>

HTML Code That Uses JavaScript:

<FORM>
<input type="button" value="Button" name="B3" onClick="javascript:history.back(1)">
</FORM>
The following HTML code adds a hyperlink that retraces the Web browser's history:
<a href="JavaScript:history.back(1)">the past</a>
NOTE: Netscape Navigator versions 4.5 and earlier require all form elements to be contained within form tags. If you are certain your browsing audience will be using Internet Explorer, you may omit the form tags from the sample above.

Netscape Navigator 2.0 and Internet Explorer 3.0 and all more recent versions of those browsers support the onClick method of the button input type.

The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

↑ Back to the top


Keywords: KB205693, kbinfo

↑ Back to the top

Article Info
Article ID : 205693
Revision : 2
Created on : 6/18/2005
Published on : 6/18/2005
Exists online : False
Views : 221