catcode.com > Guide to HTML Forms > One-Line Input

One-Line Input

'first name' field highlighted As you can see on this subscription form, the areas where you are going to enter your data have legends (in yellow on the picture, below the line) and an area for you to put your information (in green on the picture, on the line).

In a similar way, a web-based form field (or element) will have a name by which the script can find it, and the information the user enters will be the field's value.

Here's the start of our form, and what it looks like. The type="text" tells the browser to put up a one-line input area. The name="first" is the name that the server will use to find that field, and the value will be whatever you type in. Fill in the form and click the Send Data button.

<form action="showInfo.cgi" method="post">
<p>
  First name: <input type="text" name="first" />
  <br />
  <input type="submit" value="Send Data" />
</p>
</form>

First name:

The words First name: are there so that the user knows what to fill in. When the form information goes to the server, the name you typed is filed under name="first".