0% found this document useful (0 votes)
4 views

email

jknbjkn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

email

jknbjkn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

<html>

<body>

<form name="frm1">

Enter Name

<input type="text"name="t1"><br><br>

Enter Address<br>

<textarea name="t2"placeholder="PERMENANT ADDRESS">

</textarea><br><br>

Enter Telephone Number

<input type="tel"maxlength="10"><br><br>

Enter Email Addres

<input type="email"name="t3" pattern="[A-Z a-z]{5}-[@]{1}-[.]{1}"


placeholder="[email protected]"><br><br>

<input type="button" name="b1" value="submit" onClick="chk()">

</form>

</body>

<script type="text/javascript">

function chk()

var x=frm1.t3.value;

var atpos=x.indexOf("@");

var lastat=x.lastIndexOf("@");

var firstdot=x.indexOf(".");
var dotpos=x.lastIndexOf(".");

if(atpos<1||dotpos<atpos+2||dotpos+2>=x.length||firstdot<atpos||atpos<lastat)

alert("Not a valid email address");

frm1.t3.focus();

else

alert("Email address is accepted");

return true;

</script>

</html>

You might also like