Now it is time to add in some form elements - there are quite a few to choose from. Here are a list of the most important ones for PHP usage:
|
Element
|
Description
|
|
INPUT TYPE="CHECKBOX"
|
A check box that lets users select multiple options
|
|
INPUT TYPE="FILE"
|
A text box plus a button that opens a file selection dialog
|
|
INPUT TYPE="HIDDEN"
|
A hidden form element where you set the value
|
|
INPUT TYPE="PASSWORD"
|
A text box where the text is replaced by a password character (usually asterisk *)
|
|
INPUT TYPE= "RADIO"
|
A radio button. Radio buttons are liked grouped check boxes - you can only select one at a time
|
|
INPUT TYPE="RESET"
|
A button to clear the form. It's one of the weird oddities of the web that this still exists - do you know anyone who uses it?
|
|
INPUT TYPE="SUBMIT"
|
A button to submit the form
|
|
INPUT TYPE="TEXT"
|
A text box
|
|
OPTION
|
An option in a SELECT element
|
|
SELECT
|
A list box; can also be a drop down list box
|
|
TEXTAREA
|
multi-line text box
|
There are four special elements in there that are of particular note: FILE elements actually upload files to the server, and can take quite a time to transfer if the connection speed is slow - handling file uploads is covered later. Hidden elements don't appear on your users screen - they are useful when keeping information across forms and pages, or simply just to force input for certain fields.
Password elements hide the password on the client side by using *s or something similar, but it is important to note that the password is still sent in plain text - no encryption is done. Finally, text area elements need a closing tag, with the text in between forming their content, i.e.: <TEXTAREA>Some text</TEXTAREA>.