Prashant Ingale

Juice of PHP, MySQL, Apache, Linux, Actionscript, Flex

Archive for the ‘Javascript Validation’ Category

Email address validation - javascript

leave a comment

Below is simple yet powerful email validation script using regular expression.

function validateEmail(myEamil) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(myEmail.value)){
		return (1)
	}
	return (0)
}

Written by admin

August 27th, 2008 at 1:09 am