I've used many before, this is the cleanest without too much code. It features a nice onfocus clear value bonus. When the email is incorrect after click the alert box when the email is invalid, it will clear the mail input field value and bring the cursor directly to the the email input box. The email validation does not check is the email actually works, just is it appears valid, excellent for javascript!
Entries Tagged 'Javascipt' ↓
Best Javascript Email Address Validation for Forms and Input
February 8th, 2008 — JavaScript, Javascipt, Web Development
Javascript: Detect MAC Apple platform to change CSS
December 16th, 2007 — CSS, JavaScript, Javascipt, Mac, Web Development
The letter-spacing is treated differently on OSX than Windows XP. This can cause problems if you basing a design off text-based CSS. This fix works perfectly if you using a simple dropdown menu that uses absolute positions and auto margins, so its not a child of the initial menu you made, an example can be seen here: www.cmcri.org
A simple javascript code can detect a MAC platform with an IF statement, IF it is MAC then write to document a style. This code must be inserted after your initial call for your style sheet so it overwrites the original CSS code.
if(navigator.userAgent.indexOf('Mac') != -1)
{document.write ('<style type="text/css">#header ul li a{letter-spacing:.025em;}</style>');}
Easy fix!
Conjuncting Javascript Variables with Strings
October 10th, 2007 — JavaScript, Javascipt, Web Development, wed developement
To add a variable mid string in javscript use the plus operator ( + )
Example:
var page;
page = "50";
document.write("Delete Page " + page + "?");
or when used within a function
function confirmDelete(delUrl,page) {
if (confirm("Delete Page " + page + "?")) {
document.location = delUrl;
}
}