Email Address:
Basic code
Add this to your input
onblur="checkEmail()"
Any field with an id of emailaddress will be checked if this function is called.
Alternative
// Check Valid or Invalid email when user enters email in email input field.
if ($formfield == "email") {
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/", $value)) {
echo "Invalid email";
} else {
echo "Valid";
}












