Nice Clean Example

JavaScript

These samples demonstrate various JavaScript techniques.

 
Advance form field with Enter key
This sample shows how to intercept the Enter key and use it to advance in a form. Normally the Enter key will submit a form.
HTML form validation
This sample shows how to connect up a function to a form to perform client-side validation of the fields of a form before its submitted.
Declare and use an object (Class) in Javascript
Advance form field on maxlength
This sample demonstrates how to automatically advance the cursor when entering data in a textbox field. For something like a phone number, its nice to automatically advance the cursor after a certain number of characters have been entered rather than force the user to advance with tab or the cursor. The trick is to catch the "key up" event.
Confirm Delete Example
When you have a web page that allows you to delete something its very important to let the user confirm that delete processing. This javascript example demonstrates one way to do that.
Return to previous page
While browsers have a Back button it can be useful for a page to have its own way of returning to a previous page. This sample demonstrates this feature.