JavaScript
  Home arrow JavaScript arrow OnReset, OnResize and Other JavaScript Eve...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

OnReset, OnResize and Other JavaScript Events
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2007-12-17

    Table of Contents:
  • OnReset, OnResize and Other JavaScript Events
  • OnResize
  • OnSelect
  • OnSubmit
  • OnUnLoad

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    OnReset, OnResize and Other JavaScript Events


    (Page 1 of 5 )

    In our last tutorial we left off with the mouse events. We’ll be wrapping up the series on JavaScript events in this part. It’s been a long ride, but by the end of this article you should be able to create some nifty dynamic web pages. When Google buys your nerd-infested web site, don’t forget the guy who got you there.

    Before we begin, let’s take one final look at our dearly beloved JavaScript Events table: 

    Event

    What Triggers the Event

    OnAbort

    Occurs when the loading of an image is interrupted

    OnBlur

    Occurs when an element loses focus

    OnChange

    Occurs when the user changes the content of a field

    OnClick

    Occurs when the user clicks an object

    OnDblClick

    Occurs when the user double clicks an object

    OnError

    Occurs when an error occurs while loading a document or an image

    OnFocus

    Occurs when an element has focus

    OnKeyDown

    Occurs when a keyboard key is pressed

    OnKeyPress

    Occurs when a keyboard key is pressed or held down

    OnKeyUp

    Occurs when a keyboard key is released

    OnLoad

    Occurs when a page or image has completed loading

    OnMouseDown

    Occurs when a mouse button is pressed

    OnMouseMove

    Occurs when the mouse is moved

    OnMouseOut

    Occurs when the mouse is moved off of an element

    OnMouseOver

    Occurs when the mouse is moved over an element

    OnMouseUp

    Occurs when the mouse button is released

    OnReset

    Occurs when the reset button is clicked

    OnResize

    Occurs when a window or frame is resized.

    OnSelect

    Occurs when text is selected

    OnSubmit

    Occurs when the submit button is clicked

    OnUnload

    Occurs when the user exits the page

    OnReset

    This nifty little fellow is triggered when you click the Reset button on a form. In the following example, we create a form asking for the user’s first and last name. The fields have a default value of Chuck and Norris respectively. When the user enters their data and clicks the Reset button, a pop-up alert appears with the text: You fool! You reset the form! Then, the original values of the two text fields are returned. Want to see that in code? Here it be:

    <html>

    <body>


    <form onreset="alert('You fool! You reset the form!')">

    First Name: <input type="text" name="firstname" value="Chuck" />

    <br />

    Last Name: <input type="text" name="lastname" value="Norris" />

    <br /><br />

    <input type="reset" value="Reset">

    </form>


    </body>

    </html>

    Supporting HTML tags: <form>

    Supporting Javascript Objects: form

    More JavaScript Articles
    More By James Payne


     

    JAVASCRIPT ARTICLES

    - Book Review: Learning the Yahoo! User Interf...
    - Dynamically Generate a Selection List in a R...
    - Intergrate DWR into Your Java Web Application
    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget
    - Ajax Hack for Entering Information Without R...
    - EXT JS 2.1 Overview
    - Using the Style Object for Zebra Tables with...
    - Binary Searching
    - An Improved Approach to Building Zebra Tables
    - Assigning Background Colors Dynamically to Z...
    - Building Zebra Tables with CSS and JavaScript
    - JavaScript: Array Objects
    - A Closer Look at Smart Markers with Yahoo! M...
    - Using Polylines and Smart Markers with Yahoo...







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway