Section 27
USING JAVASCRIPT AND THE <FORM> TAG TO CREATE A "BACK" BUTTON
     As long as I've metioned using JavaScript, here is an example of how
to create a Button that the user can click on to return them to the
previous web page:
<FORM>
<INPUT TYPE=BUTTON VALUE="Back to Previous Page" onClick="history.go(-1)">
</FORM>
     Although the above does not appear to be using JavaScript, it does
not work if the users web browser does not have JavaScript enabled.
Therefor, I have modified it so it will not show the Button for non-
JavaScript users and will display a short message telling them to use their
web browsers Back Button instead.  Here is an example that I think works
out better than the above:
<CENTER>
<SCRIPT LANGUAGE="JavaScript">
document.write('<FORM><INPUT TYPE=BUTTON VALUE="Back to Previous Page" ');
document.write('onClick="history.go(-1)"></FORM>')
</SCRIPT>
<NOSCRIPT>
Use your Back button to return to the previous page.
</NOSCRIPT>
</CENTER>
     Here is how the above works with your web browser:
[Previous Section] [Table of Contents] [Addendum] [Milt's Micro Digest Home Page] [Next Section]
The names Microsoft, Internet Explorer, Netscape, and others used in this document
are Trademarks, or Registered Trademarks of the companies represented.
E-mail questions, comments, or suggestions to: miltst@hotmail.com
© 1999 miltst@hotmail.com

Counter
(This page was last modified on: Monday, February 08, 1999)
1