Code :
[Link]
<!doctype html>
<html>
<head>
<title>Form Validation</title>
<style>
form {border-width:5px; border-style:solid}
</style>
</head>
<body>
<h1> Information Form </h1>
<form name = "f1"><br><br>
Your Name:- <input type = text name = "txt1-nm"> <br> <br>
Address :- <textarea name = "txtar1" rows=2 cols = 30 placeholder="Parmanent Address">
</textarea><br> <br>
Contact :- <input type = tel name = "telno1" maxlength = 10> <br> <br>
Email :- <input type = email name = "email1" pattern = "[A-Z a-z]{0-9}-[@]{1}-[.]{1}"><br> <br>
<input type = button name = b1 value = "Submit" onclick="validate_email()"><br><br>
</form>
</body>
<script type = "text/javascript">
function validate_email()
{
var x=[Link];
var at_pos=[Link]("@");
var last_pos=[Link]("@");
var firstdot_pos=[Link](".");
var dot_pos=[Link](".");
if
(at_pos<1||dot_pos<at_pos+2||dot_pos+2>=[Link]||firstdot_pos<at_pos||at_pos<last_pos)
{
alert("Not an Valid email Address");
[Link]();
}
else
{
alert ("Valid Email Address");
return true;
}
}
</script>
</html>
Out Put :