forked from dharmanshu9930/Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home task.html
106 lines (94 loc) · 2.34 KB
/
home task.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html>
<html>
<head>
<title>home task</title>
<style>
.container{
width: 20%;
margin: auto;
padding-bottom: 20px;
padding-top: 20px;
margin-top: 10%
}
.register{
text-align: center;
text-align: justify;
}
</style>
</head>
<body style="background-image:linear-gradient(red,pink)">
<marquee><img src="https://hermingevorgyan.files.wordpress.com/2019/09/task.png"></marquee>
<div class="container">
<form class="register">
<!--Username of the User-->
<label>Username</label>
<input type="text" id="Username" placeholder="Username"><br>
<span id="Usererror"></span>
<br>
<!--E-mail of the User-->
<label>E-mail</label>
<input type="text" id="Usermail" placeholder="E-mail" ><br>
<span id="mlerror"></span>
<br>
<!--Password of the User-->
<label>Password</label>
<input type="password" id="Userpass" placeholder="Password"><br>
<span id="pserror"></span>
<br><br>
<input type="button" value="Submit">
</form>
</div>
</body>
<script type="text/javascript">
// validation on E-mail
var e= document.getElementById("Umail");
e.onchange = function ()
{
var ee=e.value;
if (ee==="")
{
document.getElementById("mlerror").textContent= "Enter your E-mail";
}
else
{
document.getElementById("mlerror").textContent= "";
}
}
// validation on Username
var u= document.getElementById('Uname');
u.onchange = function ()
{
var uu = u.value;
if (uu=== "")
{
document.getElementById("Uerror").textContent = "Enter Your Username";
}
else if (uu.length<"5" || uu.length>"20")
{
document.getElementById("Uerror").textContent = "username length should be in between 5 to 20";
}
else
{
document.getElementById("Uerror").textContent = "";
}
}
// validation on password
var pas= document.getElementById('Upass');
pass.onchange = function ()
{
var pass = pas.value;
if (pass ==="")
{
document.getElementById("pserror").textContent = "Enter Your Password";
}
else if (pass.length < 10 || pass.length > 20)
{
document.getElementById("pserror").textContent = "Password should not be less than 10";
}
else
{
document.getElementById("pserror").textContent = "";
}
}
</script>
</html>