View on GitHub

201-reading-notes

this is where i keep my 201 notes

CLASS 09 READING NOTES

FORMS AND EVENTS

Form Controls

How Forms Work

A user fills in a form and then presses a button to submit the information to the server. A form may have several form controls, each gathering different information. The server needs to know which piece of inputted data corresponds with which form element.

Form Structure

Forms can be sent using one of two methods: get or post. With the get method, the values from the form are added to the end of the URL specified in the action attribute. The get method is ideal for

short forms such as search boxes

when you are just retrieving data from the web server not sending information that should be added to or deleted from a database With the post method the values are sent in what are known as HTTP headers. As a rule of thumb you should use the post method if your form:

allows users to upload a file

contains sensitive data e.g. passwords

adds information to, or deletes information from, a database If the method attribute is not used, the form data will be sent using the get method.

Password Input

Text Area

TABLE PROPERTIES

You have already met several properties that are commonly used with tables. Here we will put them together in a single example using the following: