Fotiman - 4:32 am on Jan 25, 2013 (gmt 0)
Welcome to WebmasterWorld!
Remove the return false. You might put that on the form onsubmit handler, but it's not going to help on the button element (and even putting it on the form onsubmit handler is not ideal). Instead, change your <button> element to <input type="button">. Then it won't try to submit the form.
A few suggestions:
1. Use an HTML5 doctype. It's backwards compatible with HTML 4.01, but shorter:
2. Put scripts at the end of your document, just before the closing </body> tag. Preferably, put them in external .js files. It's better for performance, reusability, and maintenance.
3. In your functions, put all your variable declarations at the very beginning of the function. Don't do this:
var somevariable = somevalue;
// do some things
var anothervariable = anothervalue;
Instead do this:
var somevariable = somevalue,
// do some things
anothervariable = anothervalue;
Keeping your variable declarations at the top of the function keeps your code neater. You don't have to search all over to determine if a variable is global or if it has function scope.
3. some of your functions take a form object, but then use document.getElementById to reference specific elements in the page, including elements that you access via the form object passed in. It's a bit inconsistent, and fragile if any of the page changes. You might consider making it a little more abstract.
4. There's a lot of similar looking code that could probably be rewritten as a reusable function
5. charset meta data should be the first thing in the <head>
6. Don't use inline style attributes.
7. Don't use presentational attributes (border, align, width, etc.)
8. Don't use tables for layout.
I could probably go on, but it's not what you asked. :)
Hope this helps.