Form Buttons

There are various form buttons which can control browser side actions. These are commonly used in many sites and very easy to implement. The buttons listed below are used as form elements.

The code is listed below (cut and paste) so that you can easily implement on your page or at your site. If you are using a design program such as Dreamweaver (from Macromedia/Adobe) you can add these elements as code > snippets for future use. Or just bookmark this page. Better yet, put a link on your page!


Back button

<form>
<input type="button" value="Back" onclick="history.go(-1)">
</form>


Close window button

<form>
<input type="button" value="Close Window" onclick="window.close()">
</form>


Email with subject button

<form>
<input type="button" value="Email with submject prefilled" onclick="parent.location='mailto:info@example.com?subject=Great Form Buttons'">
</form>


Print this page button

<form>
<input type="button" value="Print Page" onclick="window.print()">
</form>


View source code button

<form>
<input type="button" value="View Source Code" onclick='window.location="view-source:"+window.location.href'>
</form>