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

K 10

Uploaded by

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

K 10

Uploaded by

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

<html>

<head>
<title> Registration Form </title>
<script type="text/javascript">
function validateForm() {
var username=document.forms["registration"] ["username"].value;
var username=document.forms["registration"] ["password"].value;
var email=document.forms["registration"] ["email"].value;
if (username=="" ||password=="" || email=""){
alert("All fileds are mandatory");
return false;
}
var re=/\S+@\S+\.\S+/;
if(!re.test(email)) {
alert("Invalid Email format");
return false;
}
if (password.length < 8) {
alert(please enter 8 characters");
return false;
}
alert("Thank you for registration");
return true;
}
</script>
</head>
<body>
<h1> Registration Form </h1>
<form name="registration" onsubmit="return validateForm()">
Username: <input type="text" name="username"><br><br>
Password: <input type="password" name="password"><br><br>
Email: <input type="text" name="email"><br><br>
<input type="submit" value="Register">
</form>
</body>
</html>

You might also like