Form Event Reference


Google
The following events are triggered by actions inside an HTML form. Although these events
apply to all HTML5 elements, they are most common in form elements:

blur Triggered when an element loses focus
change Triggered when an element changes
contextmenu Triggered when a context menu is triggered
focus Triggered when an element receives focus
formchange Triggered when a form changes
forminput Triggered when a form receives user input
input Triggered when an element receives user input
invalid Triggered when an element is invalid
select Triggered when an element is selected
submit Triggered when a form is submitted
The following is an example of subscribing to a form event:

var lastName = document.getElementById('txtLastName');
lastName.addEventListener('focus', gotFocus, false);
function gotFocus (e){
alert('last name has focus');
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s