Text Methods and Events
Methods
-
document.formname.textName.focus() sets focus on the field.
In other words, it puts the cursor on the field named textName.
How can you use this with a validation routine?
-
document.formname.textName.blur() removes focus (the cursor) from
the field named textName.
-
document.formname.textName.select() selects (highlights) the text
in the field named textName.
Event Handlers
-
onFocus happens when the field gains focus
-
onBlur occurs when the field loses focus
-
onChange fires when the user changes text and then leaves the
field. How can you use this for instant data
validation?
-
onSelect happens when text in the field is selected.
Example: textfields.html
Buttons
Home
Internet II: Day 4