-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.jsp
164 lines (149 loc) · 4.51 KB
/
signup.jsp
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<%
String message;
try
{
message=request.getParameter("message");
if(message.equals("null"))
{
message="";
}
}
catch(Exception e)
{
message="";
}
%>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Signup</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="css/global.css" type="text/css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
<!--########################Validate License Number######################-->
function validateDLNo()
{
with(document.forms.SignUpForm)
{
var lNo=dlNo.value
var re=/^(\D{2})[ -\.]?(\d{13})$/
if(re.test(lNo))
{
dlNo.value=lNo.split('-').join('')
dlNo.value=dlNo.value.slice(0,2)+"-"+dlNo.value.slice(2,15);
dlNo.value=dlNo.value.toUpperCase();
getLicense.disabled=false
}
else
{
alert("Invalid License Format..!");
dlNo.focus();
}
}
}
<!--########################Validate Password######################-->
function validatePass1(ch)
{
with(document.forms.SignUpForm)
{
if(ch==2)
{
if(pass1.value.length>=4)
{
}
else
{
alert("Password 1 must be at least four characters");
pass1.focus();
}
}
else
{
validateDLNo();
}
}
}
<!--########################Validate Confirm Password######################-->
function validatePass2(ch)
{
with(document.forms.SignUpForm)
{
if(ch==1)
{
if(pass1.value.length<4)
{
pass1.focus();
alert("Enter Pass1 first");
}
else
{
}
}
else
{
if(pass1.value==pass2.value)
{
}
else
{
pass2.value="";
alert("Password Do not match");
pass2.focus();
}
}
}
}
<!--########################End Script######################-->
</script>
</head>
<body>
<div class="container-fluid bg">
<div class="row">
<div class="col-md-4 col-sm-4 col-xs-12"></div>
<div class="col-md-4 col-sm-4 col-xs-12"></div>
<!--########################Form Start######################-->
<form class="form-container" name="SignUpForm" action="GetMyLicense.jsp" method="post"> <!--action="just.html" -->
<h2>Sign Up</h2><br>
<b><x style="color:#f1c40f;"><%=message%></x></b><p>
<div class="form-group">
<label for="username">Name:</label>
<input type="text" class="form-control" name="uname" placeholder="abc" required>
</div>
<div class="form-group">
<label for="username">Email:</label>
<input type="email" class="form-control" name="username" placeholder="[email protected]" required>
</div>
<div class="form-group">
<label for="dlNo">License Number:</label>
<input type="text" class="form-control" name="dlNo" placeholder="DL-XXXXXXXXXXXXX" onchange="validateDLNo()" required>
</div>
<div class="form-group">
<label for="pass1">Set Password</label>
<input type="password" class="form-control" name="pass1" placeholder="********" onfocus="validatePass1(1)" onchange="validatePass1(2)" required>
</div>
<div class="form-group">
<label for="pass2">Retype password</label>
<input type="password" class="form-control" name="pass2" placeholder="********" onfocus="validatePass2(1)" onchange="validatePass2(2)" required>
</div>
<div class="form-group">
<label for="Security Ans">What is Your Favorite Food Item(make sure it should be secret) :</label>
<input type="text" class="form-control" name="ans" placeholder="Your Answer Here" required>
</div>
<div class="form-group">
<label for="radio">Choose Gender</label><br><br>
<input type="radio" name="gender" value="Male" required><label for="radio">  Male</label></input>        
<input type="radio" name="gender" value="Female" required><label for="radio">  Female</label></input>
</div>
<button type="submit" class="btn btn-success btn-block" style="background:#4FB9BA;" disabled="true" name="getLicense"/>Get My License</button>
<h5>Already Have an account? <a href="login.jsp"><b><x style="color:#f1c40f;">Login</x></b></a></h5>
</form>
<!--########################Form End######################-->
</div>
<div class="col-md-4 col-sm-4 col-xs-12"></div>
</div>
</body>
</html>