## New Window

This button opens a new window where you can control its properties (scrollbars, size, status...). To do that, answer yes or no, or change the numbers. You can also make the window open to a link or a file.

<FORM><input type="button" Value="Open Window" ONCLICK="window.open('YOUR LINK GOES HERE', 'Sample', 'toolbar=yes,location=yes,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=yes,width=635,height=260')"> </FORM>

## Form Using Mailto:

Enter your URL:
Enter a description:

Put this part in the `<head></head>` part of your document.

<script language="JavaScript"> function mailMe( form ) { // put some checks here return true; } </script>

Now put this part in the body of your document. >

<form name="testform" method="POST" action="mailto:YOUR E-MAIL ADDRESS?subject=YOUR SUBJECT" onSubmit="return mailMe( this.form )" enctype="text/plain"> Enter your URL:<br> <input type="text" name="URL" value="http://" size=50><br> Enter a description:<br> <input type="text" name="description" value="" size=50><br> <input type="submit" value="Submit URL"> </form>

Now change the e-mail address and subject. If you want to add another box, just insert this line
<input type="text" name="ANY NAME" value="" size=50><br>
You can also change the size of the forms by changing the numbers where it says "size="

## Form Using Mailto: - Validation

Name:
Email:
URL:
Description:

Put this in your `<head></head>` tag

<script language="JavaScript"> <!-- function validate_form() { validity = true; // assume valid if (!check_empty(document.form.NAME.value)) { validity = false; alert('Name field is empty!'); } if (!check_email(document.form.EMAIL.value)) { validity = false; alert('Email address is invalid!'); } if (!check_url(document.form.URL.value)) { validity = false; alert('URL field is invalid!'); } if (!check_empty(document.form.DESCRIPTION.value)) { validity = false; alert('Description field is empty!'); } if (validity) alert ("Needed entries have been verified. " + "Your form is now being passed to your browser's " + "Mail Delivery Sub-System."); return validity; } function check_empty(text) { return (text.length > 0); // returns false if empty } function check_email(address) { if ((address == "") || (address.indexOf ('@') == -1) || (address.indexOf ('.') == -1)) return false; return true; } function check_url(address) { if ((address == "") || (address.indexOf ('http://') == -1) || (address.indexOf ('.') == -1)) return false; return true; } // --> </script>

Now put these lines somewhere in your body.

<form name="form" method="post" action="YOUR EMAIL ADDRESS ?SUBJECT=YOUR SUBJECT" enctype="text/plain" onSubmit="return validate_form()"> Name:<br><input type="text" size=50 name="NAME"><br> Email:<br><input type="text" size=50 name="EMAIL"><br> URL:<br><input type="text" size=50 name="URL"><br> Description:<br><TEXTAREA NAME="DESCRIPTION" ROWS=8 COLS=50 wrap=virtual></TEXTAREA><br> <input type="submit" name="submit" value="Submit"> <input type="reset" value="Reset"></form>

## Link Button

Just copy this short line and change the link location and the button description.

<form><INPUT TYPE="button" VALUE="BUTTON DESCRIPTION" onClick="parent.location='LINK LOCATION'"></form>

Link Button Frames

Copy this line and change the link location, the button description, and the FRAME TARGET NAME to the name of the frame that you want the link to go.

<form><INPUT TYPE="button" VALUE="BUTTON DESCRIPTION" onClick="parent.FRAME TARGET NAME.location='LINK LOCATION'"></form>

Back And Forward Buttons

Now put this code anywhere you want the buttons to go. You can also change what the buttons say by replacing "BACK" and "FORWARD" with whatever you want.

<SCRIPT LANGUAGE="JavaScript"> <!-- hide this script tag's contents from old browsers function goHist(a) { history.go(a); // Go back one. } //<!-- done hiding from old browsers --> </script> <FORM METHOD="post"> <INPUT TYPE="button" VALUE=" BACK " onClick="goHist(-1)"> <INPUT TYPE="button" VALUE="FORWARD" onClick="goHist(1)"> </form>

## Back And Forward Buttons - Frames

Here's any easy way to use the back and forward buttons in frames. These buttons have to go into another frame other than the main frame, they won't work without frames! A working example is down in the lower left hand corner. Just copy this code and change FRAME TARGET NAME to the name of the frame that you want to go back and forward.

<form> <INPUT TYPE="button" VALUE="BACK" onClick="parent.FRAME TARGET NAME.history.back()"> <INPUT TYPE="button" VALUE="FORWARD" onClick="parent.FRAME TARGET NAME.history.forward()">

## Back And Forward Image Button

Here you can make use of the back and forward functions with pictures. All you need to do is copy this 2 lines. Just change the uppercase text.

<a href="" onClick="parent.history.back(); return false;" onMouseOver="self.status='Back'; return true;"><img src="YOU PICTURE" border=0></a> <a href="" onClick="parent.history.forward(); return false;" onMouseOver="self.status='Forward'; return true;"><img src="YOUR PICTURE" border=0></a>

## View Source Button

Here's the source code,

<form><INPUT TYPE="BUTTON" VALUE="View Source" onClick= 'window.location = "view-source:" + window.location.href'> </form>

## View Source Button - Frames

(This will view the menu on the left side.)
Here's the code, all you need to do is to change the FRAME TARGET NAME.

<form><INPUT TYPE="BUTTON" VALUE="View Source" onClick= 'parent.FRAME TARGET NAME.location = "view-source:" + parent.FRAME TARGET NAME.location'> </form>

## Reload Button

(This reloads the entire window.)

<form><INPUT TYPE="button" VALUE="Reload" onClick='parent.location="javascript:location.reload()"'></form>

Just copy this line of code.

## Reload Button- Frames

(This will only reload the counter in the bottom left.)
Just copy this line and change the FRAME TARGET NAME.

<form><INPUT TYPE="button" VALUE="Reload" onClick='parent.counter.location="javascript:location.reload()"'></form>

## Home Button

Click this button to goto your browser home page (Only works in Netscape 4).

Put this code wherever you want the button to go in your page.

<script> function gohome(){ if((navigator.appVersion.indexOf("4.") != -1) && (navigator.appName.indexOf("Netscape") != -1)){ home();} } </script> <form><input type="button" value="Home" onClick="home();"></form>

## Print Button

Click the button to print this page (Only works in Netscape 4).

<script> function printthis(){ if((navigator.appVersion.indexOf("4.") != -1) && (navigator.appName.indexOf("Netscape") != -1)){ print();} } </script> <form><input type="button" value="Print" onClick="printthis();"></form>