Pages

1 May 2012

Cs101 2nd assignment solution spring 2012

<html>

<head>

<script type="text/javascript">

function CheckMyEmail()

{

var x=document.forms["myForm"]["email"].value;

var at=x.indexOf("120200697@");

var dot=x.lastIndexOf(".");

if (at<1 || dot<at+2 || dot+2>=x.length)

{

alert("OOps...Error...XXX... You entered an invalid email address. check your spelling and try angain...");

return false;

}

else

{

alert("Conratulation..! Welcome to Mr. Abdul Rehman Now you have Logged in......>>>>>> you have entered mc120200697@vu.edu.pk your valid email address..");

}

}

</script>

</head>


<body>

<form name="myForm" action="example.html" onsubmit="return CheckMyEmail();" method="post">

Email: <input type="text" name="email">

<input type="submit" value="Submit">

</form>

</body>


</html>

0 comments:

Post a Comment