-
Notifications
You must be signed in to change notification settings - Fork 1
/
P6.html
33 lines (30 loc) · 902 Bytes
/
P6.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!-- Program 6:- Write a Program to validate username and password. -->
<script>
function validateform()
{
var name=document.myform.name.value;
var password=document.myform.password.value;
if(name==null || name=="")
{
alert("Name Can't be Blank");
return false;
}
else if(password.length<6)
{
alert("Password must be at least 6 character long.");
return false;
}
}
</script>
<html>
<head>
<title>Lab_Program_6</title>
</head>
<body style="font-size:30px">
<form name="myform" method="post" action="abc.jsp" onsubmit="return validateform()">
Name:<input type="text" name="name"><br/>
Password:<input type="password" name="password"><br/>
<input type="submit" value="register">
</form>
</body>
</html>