HTML reference
input type="submit"
A submit input is a form control that asks the browser to submit its form. Its visible label comes from the value attribute.
What you will learn
- How
submitsends a form - What
valueandnamedo - When to use a normal button instead
Basic example
<form action="/register" method="post">
<label>Name <input name="name" required></label>
<input type="submit" value="Create account">
</form>Submitting runs the form's validation and sends successful controls to the form's action using its method. A submit input without a form ancestor usually has no useful submission context.
value and name
value supplies the visible label. If the submit control also has a name, its name/value pair can tell the server which submit action was chosen. Do not rely on the visible label alone for security decisions.
submit or button?
<button type="submit"> can contain richer text or markup and is often easier to style. Use button type="button" for an action that should not submit the form, such as opening a picker.