For standard HTML attribute information about the <INPUT>
element, see the <INPUT>
topic.
The <INPUT>
element supports a variety of scripting functions depending on the TYPE
specified in the element. Currently, the <INPUT>
element accepts the following TYPE
s of element that can be scripted : BUTTON
, CHECKBOX
, PASSWORD
, RADIO
, RESET
, SUBMIT
, TEXT
. In the following paragraphs, the text has been detailed by scripting function and the TYPE
attributes they can be used with.
OnClick - supported by : BUTTON
, RESET
, SUBMIT
, CHECKBOX
, RADIO
The OnClick
event can be used to execute script functions when the particular element is clicked with the users mouse. As far as the button types (i.e. BUTTON
, SUBMIT
and RESET
) are concerned, it could be used to execute form data validation scripts for example.
OnFocus - supported by : BUTTON
, RESET
, SUBMIT
, CHECKBOX
, RADIO
, TEXT
, PASSWORD
The OnFocus
event can be used to execute script functions when the particular element receives the users focus, either by clicking inside the element, or by tabbing (at least on Windows based systems) through the elements using the TAB key.
OnBlur - supported by : TEXT
, PASSWORD
The OnBlur
event can be used to execute script functions when the user moves the focus away from the particular element. by either clicking another element on the document, or by tabbing past the element.
OnChange - supported by : TEXT
This event executes script functions when the user actually changes some text in the textbox, specified by the <INPUT TYPE="TEXT">
element.
OnSelect - supported by : PASSWORD
, TEXT
The OnSelect
event handler can be used to execute script functions when the user selects some text in the textbox. NOTE : Although this event handler is documented by both Netscape and Microsoft in their browser's documentation, on testing it did not seem to work.