Sie sind auf Seite 1von 1

<html>

<head>
<title>User Registration</title>

<script>
function check()
{
var u=document.f1.usr.value;
var p=document.f1.pwd.value;
var cp=document.f1.cpwd.value;
var e=document.f1.email.value;

if(u=="" || p=="" || cp=="" || e=="")


{
alert("Insert all data");
return false;
}else if(p.length<6)
{
alert("Password must be at least six characters
long");
return false;
}else if(p != cp)
{
alert("Password and confirm password must be same");
return false;
}else if(e.indexOf("@") == -1 || e.indexOf(".") == -1)
{
alert("Email must contain @ and dot character");
return false;
}
}
</script>
</head>

<body>

<form name="f1" action="examinsert.php" method="post" onsubmit="return check()">

username :
<input type="text" name="usr"><br/>

Password :
<input type="text" name="pwd"><br/>

Confirm Password :
<input type="text" name="cpwd"><br/>

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

<button type="submit">Insert New Record</button>


<button type="reset">Clear</button>

</form>

</body>
</html>

Das könnte Ihnen auch gefallen