'JavaScript Code' Category

September 11th, 2006

Count the Number of Characters with JavaScript

Sometimes you need a quick way to count the number of characters in a string. Suppose you're limiting a textarea to 1000 characters, you'll want to show the user how much more they can type. Or, perhaps a forum limits your signature length, and you want a quick way to validate it (including BB Code [...]

Share
August 30th, 2006

How to make a link open in a new window with XHTML

The old-fashioned method of opening a link in a new window is to use the attribute target="_blank". Unfortunately, if you use an XHTML validator, you'll find that this attribute has been deprecated. Originally it was proposed to use the 'rel' attribute, like this: rel="external". Although this validates, it doesn't cause the browser to open a [...]

Share
June 12th, 2006

Capturing Key Codes with JavaScript

Ever wonder how ThinkFree of Gmail are able to save your content when you hit 'Ctrl + s'? They are capturing the key combination, and using to it fire a client-side function. Here's a function you can adapt to use whichever keycode or combination to suit your purposes.

Share
May 5th, 2006

Build a Basic Calculator With JavaScript

Here's some rather simple HTML & JavaScript code I've found to include a fairly basic but functional calculator on any web page.

Share
April 30th, 2006

Create a Scrolling Check Box List

If you are using the CheckBoxList control in ASP.Net, or you just have a bunch of options for users to check, a large number of check boxes options can take up a lot of room on your web page. Also, you may have a <select> with a lot of options, you need to allow multiple [...]

Share
« Previous PageNext Page »