Forms

Now suppose that you have put up some information on the Web, but now you want some feedback on your pages from the lucky recipients out there in WebLand. Or, you genuinely can order some pizza if you live in one bit of the States. Or you can set up a book-shop and want to be able to receive an order. Should you ask for credit card details on your forms? The jury is out: obviously the internet traffic could be intercepted, but then so can telephone calls and most people do not worry about this.

The way to do this is by using forms, which are supported by most browsers and servers. In this example form you can see fill-in text fields, list boxes, radio buttons and check-boxes. There's always a push-button to submit the form for processing. This is the HTML for this form.

It must be said, here and now, that forms are not the be-all and end-all of user interface design. In HTML there is no way to specify that a field is a integer or date, or even that it should not be empty. Worse, if your eventual executable detects an empty field and returns a suitable message, then when you get back to Windows Mosaic it has sagely decided to clear the form of any user input. There is a dubious technique to get round this problem, described later. So, normally the user has to get it right in one fell swoop. Mosaic also does not allow tabbing between fields, short-cuts, and other Windows niceties. On my screen, check boxes and radio buttons do not look too good. All this said, Web forms do provide a way of getting simple information from the rest of world whatever computer they run.

Please see the FORM box page for the syntax of form HTML tags. You can set up named fields with default values. Once the form is filled in, the results are sent (by one of two methods) to your program as fieldname=value. If a field name is repeated then it can be sent twice.

Blank text fields have fieldname= sent. For check boxes, if the box is selected then the default value is sent; otherwise even fieldname= is omitted. You can implement group radio buttons by giving them the same name, but different values - the browser handles the rest.

For each form, an ACTION parameter to the

tag specifies which URL should be run to process the results - this will be your PC executable.
Return to Web Forms