Curriculum
Course: HTML Basic
Login

Curriculum

HTML Basic

HTML Introduction

0/1

HTML Editors

0/1

HTML Attributes

0/1

HTML Paragraphs

0/1

HTML Formatting

0/1

HTML Comments

0/1

HTML Favicon

0/1

HTML Page Title

0/1

HTML Iframes

0/1

HTML Java Script

0/1

HTML File Paths

0/1

HTML Symbols

0/1
Text lesson

The Submit Button

The <input type=”submit”> creates a button to submit the form data to a form-handler.

Usually, the form-handler refers to a file on the server containing a script to process input data.

The form-handler’s location is specified in the form’s action attribute.

Example

A form featuring a submit button:

<form action=”/action_page.php”>
  <label for=”fname”>First name:</label><br>
  <input type=”text” id=”fname” name=”fname” value=”John”><br>
  <label for=”lname”>Last name:</label><br>
  <input type=”text” id=”lname” name=”lname” value=”Doe”><br><br>
  <input type=”submit” value=”Submit”>
</form>

The Name Attribute for <input>

It’s important to note that each input field must include a name attribute to be submitted.

If the name attribute is left out, the value of the input field won’t be sent.

Example

In this example, the value of the “First name” input field will not be submitted:

<form action=”/action_page.php”>
  <label for=”fname”>First name:</label><br>
  <input type=”text” id=”fname” value=”John”><br><br>
  <input type=”submit” value=”Submit”>
</form>

 

Click to Learn