Tutorial 13: Giving Form to Forms - HTML with Style | WebReference

Tutorial 13: Giving Form to Forms - HTML with Style

index123456789101112131415161718192021exercises1

Tutorial 13: Giving Form to Forms

The Formation of Forms

In the beginning, there was the Web (this is not a biblical reference. There just happens to be a beginning to this story and the Web just happened to be around at that time. And I'm quite sure it took a bit longer than seven days to pull that one off, anyway). This was nice, and the Web could be used to author and browse hyperlinked documents, so that people could read them and jump from one to the other.

But, you know people. They wanted more. They wanted to submit some input and get the corresponding output. This is what computer science professors would call interactivity. And this was why forms were invented.

You see, it wasn't enough that they could handily get to, say, a company's telephone directory from anywhere in the world and look up a name. They wanted to be able to enter a name in a form, click on a button, and get the corresponding phone number. As you might well know, people were never fond of scrolling or clicking more than they have to. (Some say this is a huge conspiracy of computer mice that developed consciousness and decided they would no longer be oppressed and exploited and used as pointing devices. Others say that people are just lazy. These are the same people that claim that Oswald killed JFK and that the Roswell incident was all about a weather ballon. The truth is out there).

Anyway, even allowing for the brain-washing effects of the conspiracy, things were nice and simple, but it quickly got more complicated. Forms were later needed to do more complex things like submit address and billing details to order things, or subscribe to publications, and to answer various other needs that arose when the Web became more interactive. You see the lazy people decided that even though they could search the phone directory from afar, it would be nice to be able to, say, submit their own entry over the Web instead of picking up the phone and talking to someone and being sociable for a change. Oh well, you know people.

And thus we got the complicated HTML forms we have today. Well, OK they're not that complicated. But we also, technically, don't completely have them, at least not today, in the strictest sense of the word. Maybe we will have them sort of tomorrowish and we have to settle for a simple subset of these while browser makers get their act together. But hey, I'm sure you're used to that by now.

An HTML form does two things: First of all, it displays a bunch of controls (text fields, lists of items, buttons, radio buttons, checkboxes etc.) in a Web page and allows the user to enter information through them. This is what computer science professors call widgets. We'll call them form controls instead because I'm in the middle of my exams and not feeling particularly partial towards computer science professors right now. These do the job of figuring out what the user wants (not the big house, good marriage, fast car and short-lived mother-in-law kind of thing, although I'm sure you could build a form for that as well...). Secondly, a form tells the browser where to send the information after it has been submitted by the user. This is what computer science professors call processing, but we'll call it form submission instead, for the reasons stated above. The third part of the process, which is handling this information and doing something useful with it, such as displaying results, has nothing to do with HTML. This wouldn't get you any marks in exams, so we'll still have a look at how it's done.

HTML 4.0 offers a very comprehensive solution for using forms in HTML documents, which offers powerful data entry mechanisms and also addresses accessibility issues so that disabled people can use forms to their full extent. Internet Explorer 4.0 does a pretty good job of implementing most of this part of the specification with a few significant omissions. Internet Explorer 5.0 has made no progress in this area, and supports the same features as version 4.0. Netscape Navigator 4.0 implements a more simplistic version of forms closer to the HTML 3.2 specification, which is also representative of what other browsers support (including earlier versions of Internet Explorer and Navigator), while Mozilla currently does everything, to the best of my knowledge.

index123456789101112131415161718192021exercises1

Produced by Stephanos Piperoglou

URL: https://www.webreference.com/html/tutorial13/1.html

Created: May 28, 1998
Revised: February 25, 1999