HTML and CSS Reference
How forms work
in the browser
To a browser, a form is just a bit of HTML in a page.
You'll see that you can easily create forms in your
pages by adding a few new elements. Here's how a
form works from the browser's perspective:
The browser loads the page
The browser loads the HTML for a page like
it always does, and when it encounters form
elements, it creates controls on the page that
allow you to input various kinds of data. A
control is just something like a button or a text
input box or a drop-down menu—basically
something that allows you to input data.
You enter data
You use the controls to enter data. Depending
on the type of control, this happens in
different ways. You can type a single line of
text into a text control, or you might click one
option of many in a checkbox control. We'll
look at the different kinds of controls shortly.
You submit the form
You submit the form by clicking on a submit
button control. That's the browser's cue that it
needs to package up all the data and send that
data off to the server.
The server responds
Once the server has the form data, it passes
it off to the appropriate server script for
processing. This processing results in a
brand-new HTML page that is returned to
the browser, and since it's just HTML, the
browser displays it for you.