Answers for "email validation in js pattren of @ .com _ w3school"

-1

email validation in javascript

/* JavaScript: validating email address */

isValidEmail("[email protected]"); // true

function isValidEmail(email) {
	var emailRegex = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	return !!email && typeof email === 'string'
		&& email.match(emailformat)};
};
Posted by: Guest on May-02-2020
0

Email Validation in JavaScript

<!DOCTYPE html>
<html>
<head>
	<title>Email validation</title>
	<script type="text/javascript">
		function email_funnction() {
			var email = document.emailform.email.value;
			if(email.indexOf('@')<=0){
				document.getElementById('errormsg').innerHTML="Invalid your Email Address";
				return false;
			}     
			if ((email.charAt(email.length-4)!='.') && (email.charAt(email.length-3)!='.')) {
				document.getElementById('errormsg').innerHTML="Invalid your Email Address";
				return false;
			}
		}

	</script>
</head>
<body>
	<h1>Email Validation in javascript</h1>
	<span id="errormsg"></span>
<form name="emailform" onsubmit="return email_funnction()">
	
	<label>Email</label>
	<input type="text" name="email" value="">
	<input type="submit" name="" value="Submit">
</form>
</body>
</html>
Posted by: Guest on July-05-2020

Code answers related to "email validation in js pattren of @ .com _ w3school"

Code answers related to "Javascript"

Browse Popular Code Answers by Language