Designing a form

A "form" on the web is considered to be zero or more form elements, plus a submit button. These forms are designed to electronically replicate the forms we've all filled in hundreds of times before in real life - signing up for a bank account, a passport, etc. You start your form using the <form> HTML tag, and therefore you end with </form>. By separating forms like this, you can have multiple forms on one page.

Given the above definition, here is the most basic form in HTML:

<input="submit" />

What does it do? Well, very little, really - it will simply show a button with "Submit Query" written on, which will not submit any data when clicked. The screenshot below is how it looks in Konqueror running on Linux:

There are two key attributes to the <form> tag that you should be aware of and use: action, and method. Action sets the location of the page that will handle the results of the form - the place where the variables should be sent. Method describes how the data should be submitted, and you have two options: GET and POST.


Next chapter: GET and POST >>

Previous chapter: What does it mean to be dynamic?

Jump to:


Home: Table of Contents

Follow us on or Twitter

Username:   Password:
Create Account | About TuxRadar