Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
onsubmit event
onblur event
onchange event
onfocus event
onselect event
EVENT: onreset
onreset="action"
The
onreset
event occurs when a user resets or clears a form, rather than submitting. The event causes a script to execute that performs a desired task. For example, you could call a function or display an alert box offering additional information to the user.
These six events are useful when dealing with forms and form elements:
onblur
- runs a script when the element loses focus.
onchange
- runs a script when the element changes.
onfocus
- runs a script when the element gets the focus.
onreset
- runs a script when the form is reset.
onselect
- runs a script when the element is selected.
onsubmit
- runs a script when the form is submitted.
In this example, clicking the reset button causes an alert box to be displayed with a message.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DevGuru XHTML onreset Example</title>
</head>
<body>
<form
onreset="alert('Default color restored')"
>
Please enter your favorite color:
<br />
<input type="text" name="fullname" size="20" value="lavender">
<br />
<input type="reset" value="Reset">
</form>
</body>
</html>
Output:
Click to view and test form in separate window
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information