Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
<FORM>...</FORM>
These tags must begin and end your form.
<INPUT>
This tag creates various input fields.
Pairing this tag with the following attributes allows you to manipulate specific field designations:
NAME is the name of this field.
VALUE is the string or numeric value that is sent with this field.
CHECKED applies to checkboxes and radio boxes and defines if they are checked on page load.
TYPE determines which type of input this field is.
o TEXT-A plain text box.
o PASSWORD-A text box that echos bullets when you type into it. The bullets hide the typed
text.
o CHECKBOX-Renders a small box that indicates whether it is selected. Usually for Yes or No
questions. They are commonly referred to as checkboxes.
o RADIO-Renders a small circle that allows you to choose one among many options. They are
commonly referred to as radio buttons.
o IMAGE-Returns the coordinates of the image selected here (with x=num, y=num as the
parameters returned). This is very similar to imagemaps, but is useful if you want to just
return the xy value that someone clicks. The following is an example:
<INPUT NAME="thisimage" TYPE="IMAGE" SRC="jonjie.jpg" ALIGN="TOP">
o SUBMIT-When this is clicked, it submits the form.
o BUTTON
o RESET-Clears all input fields and resets to the defaults.
o MAXLENGTH sets the maximum number of characters to be allowed within a field of a text
or password type.
<SELECT>…</SELECT>
These tags present either a scrolling list of choices or a pop-up menu.
NAME is the name of the data (required).
SIZE determines how many choices to show. If set to 1 or omitted, it renders a pop-up menu. If set
to 2 or more it is a scrolling list.
MULTIPLE allows you to select multiple options and always renders a scrolling list.
<OPTION>
Contained within the SELECT and /SELECT tags, this tag designates a selectable item.
VALUE is the value returned when the form is submitted if this option was selected.
SELECTED means when the page is loaded, this option is selected by default.
<TEXTAREA>…</TEXTAREA>
These tags provide an area for a user to enter multiple lines of text. This defaults to four rows in length, with
each row 40 characters wide.
NAME defines the name for the information (required).
ROWS is the number of rows in this field.
COLS is the number of characters wide this field is.
WRAP determines how text flows inside a text area. You have three options for this attribute:
o OFF-No text wrap.
o VIRTUAL-Text flows to right border then wraps to next line.
o PHYSICAL-Text flows beyond right border beyond the text area window.
form Attributes
<FORM
NAME = "formname"
TARGET = "windowname" \ TARGET specifies the window that the responses go to.
ACTION = "serverURL"
METHOD = GET | POST
[ onSubmit = "handlerText" ] > \ The event handler onSubmit is optional.
</FORM>
The button Object The button object is a new type of INPUT tag that allows you to create general
purpose buttons in a form.
checkbox Object
<html>
<script language="javascript">
function mystatus()
{
(document.theForm.theCheckbox.checked) ?
alert("The box is checked") :
alert("The box is not checked! Oh no!")
}
</script>
<form name="theForm">
<input type="checkbox" name="theCheckbox" value="myValue" onClick="mystatus()">
</form></html>
The radio Object This object allows a user to make a choice of a single selection from many.
<INPUT
TYPE="radio"
NAME = "radioName"
[CHECKED]
[onClick = "handlerText"]>
textToDisplay
The text Object The text input field in an HTML document is your workhorse for inputting many types
of information. Most other types of input in forms are derivations of this kind of input.
The textarea Object When you need a user to input more than just one line of text in a form you use
the textarea input type.
The submit Object The submit button was originally intended in HTML to be the final button a user
would click to send a form back to the server.
The reset Object The reset button allows a user to completely reset a form's input fields to their
defaults.