Coding Tips (JavaScript/CSS/VBA/Win32)

Useful code snippets, tips and some Windows applications

Here you will find some tips for JavaScript deveopers.

Javascript Cookies

How to use cookies to remember values typed into a text box
JavaScript Formatting Functions
A Javascript function to format a number.
A Javascript function to remove a cents portion from a number.
JavaScript Backslash Function
A Javascript function to insert a backslash before a double quote.
JavaScript Trim Function
A Javascript function to trim a string, left and right.
JavaScript Tips
How to prevent the Enter button from submitting the form in Internet Explorer
How to keep the focus on an invalid field
Make a text-box read-only
More JavaScript Tips
Disable Right Button Click On Images
Check if a Variable Exists
Passing Arguments to The Onload Event Function
CSS Tips
Change text-box background color
How to right-align text in the HTML text-box
DOM
Edit In Place - Turn a text entry into an HTML input tag dynamically

Validation (Regular Expressions)

Regexp Number Pattern for JavaScript
This number pattern supports optional decimals and the minus sign
Various regexp patterns
Regular Expression patterns for time, date, zip/postal code, social insurance number and currency
Function to allow numbers only
Users can type numbers only in a text-box
Currency/Number Validation function
This function will return true if the parameter value is a currency or a number
Very useful JavaScript validation routines by Karen Gayda
A MSDN article on validation

Links

Top-rated JavaScript books from Amazon.com

Sorting HTML Tables using Javascript

An extensive JavaScript Form FAQ Knowledge Base from It.org