Format Code Now
/
Web & markupHTML Submit Input Generator Next: HTML Superscript Generator ›

HTML Submit Input Generator

WM-40

Type the button text and copy an input of type submit, or the button element version. Per-button form attributes such as formmethod and formnovalidate are supported.

Runs in your browser. Nothing is uploaded.

Button text (optional lines: name:, form:, formaction:, formmethod:, formtarget:, formnovalidate:, disabled:, autofocus:)

HTML

How to use it

  1. Type the button text. Leave it empty to use the browser default label.
  2. Add name:, formaction:, formmethod:, formnovalidate: or other lines.
  3. Pick the input or button action.
  4. Copy the markup into your form.

Input or button

An input of type submit is a single tag, and its label is the value attribute, so it holds plain text only. A button of type submit can contain other markup such as an icon, though this tool writes only text. Both send the form. With no label, the input shows the browser default, usually Submit in the page language. Pressing Enter in most text fields uses the first submit button as the one that sends the form.

Overriding the form per button

The form attributes on a submit control apply to that button only. formaction sends the data to another address, formmethod uses get, post or dialog, formtarget picks where the answer opens, and formnovalidate skips browser validation, which suits a Save draft button next to a Submit. A name on the button is sent with the data only when that button was used, so the server can tell which one was pressed.

Error messages and what to do

MessageWhat it meansFix
"formmethod:" must be get, post or dialog.The formmethod line had another value.Use get, post or dialog.

Questions people ask

How do I add a submit button in HTML?

Use an input with type="submit", or a button with type="submit", inside a form. The text is the value attribute on the input and the content on the button.

What is the default text of a submit input?

If value is not set, the browser shows its own label, usually Submit, in the page language. Giving a clear label such as Send message is more helpful.

How do I have two submit buttons do different things?

Give each a name and value and check which arrives, or use formaction on each so they send to different addresses. Only the button used is sent.

What does formnovalidate do?

It tells the browser to skip form validation when that button is used. It is handy for Save draft buttons, where incomplete data is fine.

Should I use input or button for submit?

Both work. Use button when you want richer content such as an icon next to the text, and input for the simplest case. Style both the same way with CSS.

About this tool

The input action writes <input type="submit"> with your text as its value. With no text, the attribute is left out and the browser shows its own default label. The button action writes <button type="submit">, which can hold more than plain text in your own markup; this tool writes the text only, and uses Submit when you give none. Lines such as formaction: and formmethod: override the form for this one button; formmethod must be get, post or dialog. Boolean lines like formnovalidate: true add the bare attribute. The tool does not build the surrounding form. Optional lines: id:, class:, title:, lang:, data-* and aria-*.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.