JavaScript: Convert input text to upper or lower case

To convert to upper case, add onChange attribute to <input> and call toUpperCase() function:

<input type="text" onchange="javascript:this.value=this.value.toUpperCase();" />

to convert to lower case:

<input type="text" onchange="javascript:this.value=this.value.toLowerCase();" />

HTML: Definition List

I always forget the syntax for <dl>, <dt> and <dd> tags, even though it’s obvious – list, terms and definition / description.

Here’s the correct syntax:

<dl>
    <dt>the term</dt>
    <dd>description</dd>
</dl>

PHP: Display errors

For security reasons, display_errors should be turned off in php.ini. This will not display the error on the browser.

However it’s inconvenient during development not being able to see the error and have to access error logs. This can be turned on with this code:

ini_set("display_errors", 1); 
error_reporting(E_ALL &&; ~E_NOTICE && E_WARNING);

This code should be removed / commented when put in production.

Color Scheme Generator

My biggest nightmare working on web development projects is trying to come up with a good color scheme for the site. I’m never a designer and I’m colorblind when it comes to this.

At work the graphic designer does the job, But when I’m on my own, I rely on this web-based color scheme generator.

Just select a color on the color wheel, click here and there, you can get some good color combinations out of it.

Update 26/05/09

This is still my favorite tool and i just discovered it has a new version – a better interface with sample site preview.