HTML and CSS Reference
In-Depth Information
the form, such as a checkbox, radio button, or text field. By naming each of the forms
and its respective elements, it is much easier to work with them in JavaScript. (See Chap-
ter 11 for a complete discussion of the forms[] array.) There are a number of events asso-
ciated with the form's elements. Many of them were also covered in Chapter 11. They
are listed in Table 13.6.
Table 13.6 Event Handlers for the Form's Elements
Object
Event Handler
button
onClick, onBlur, onFocus
checkbox
onClick, onBlur, onFocus
FileUpLoad
onClick, onBlur, onFocus
hidden
none
password
onBlur, onFocus, onSelect
radio
onClick, onBlur, onFocus
reset
onReset
select
onFocus, onBlur, onChange
submit
onSubmit
text
onClick, onBlur, onFocus, onChange
textarea
onClick, onBlur, onFocus, onChange
13.6.1 Buttons
One of the most common GUI form elements is the button. The button object has no
default action and is normally used to trigger an event such as the onClick event. HTML
4 allows you to create a <button> tag without the <input> tag. 3 There are several buttons
associated with a form; the buttons are called:
submit
reset
button
If an event handler, such as onSubmit or onChange is an attribute of a form tag, then
the event occurs when the user clicks one of the buttons associated with the form object.
Form event handlers are listed in Table 13.7.
3. The <button> </button> tags give greater flexibility to the appearance of the button by allowing HTML con-
tent to be displayed instead of plain text that is assigned to the value attribute of a button created using
the <input type="button">.
 
 
Search WWH ::




Custom Search