submit button and reset button


<input type="submit"><input type="reset">

Browser
Internet Explorer Firefox Opera
Type
Inline-block Empty

The INPUT element defines an input field. When you specify "submit" (or "reset") for the type attribute of this element, a submit button (or a reset button) is created.


<input type="submit" value="Submit">

<input type="reset" value="Reset">


Attribute Value Explanation
type=" " submit the type of input field
submit : creates a submit button
reset : creates a reset button
reset
name=" " button name a unique name for the button
value=" " button text the text displayed on the button

type="submit"

Creates a submit button on the form.

When this button is clicked, the form data is submitted to the server.

type="reset"

Creates a reset button on the form.

When this button is clicked, the input is reset.

name=""

The button name is used to identify the clicked submit button.

value=""

Value is the text displayed on the button.

Tips and Notes

The style of the button can be changed with CSS. Please see the "Related Document" for details on CSS.


Example

<form method="POST" action="example.cgi">

<p><input type="text" name="name" size="30"></p>

<p>
<input type="submit" value="Submit Button">
<input type="reset" value="Reset Button">
</p>

</form>
Output

This form cannot submit because of a sample.


<form method="POST" action="example.cgi">

<p><input type="text" name="name" size="30"></p>

<p>
<input type="submit" name="button_a" value="Button A">
<input type="submit" name="button_b" value="Button B">
<input type="submit" name="button_c" value="Button C">
<input type="reset" value="Reset">
</p>

</form>
Output

This form cannot submit because of a sample.