forked from alc-cohort1/GroupWork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
213 lines (149 loc) · 5.76 KB
/
index.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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Class assignment. Were chrome group</title>
</head>
<body>
<script>
<!--
//am validating an html form, this form is meant for validation, values must be entered or else you nwont be able to sunmit
function validate(){
var user = document.getElementById("UserId");
var pass = document.getElementById("Password");
var name = document.getElementById("Name");
var adress = document.getElementById("Adress");
var country = document.getElementById("Country");
var zip = document.getElementById("Zipcode");
var email= document.getElementById("Email");
var sex = document.getElementById("Sex");
var Language = document.getElementById("Language");
var about = document.getElementById("About");
// lets get started with validation. make sure the user does not submit more than required values
if(user.value.length < 4 || user.value.length >= 21)
{
alert("Identification values required and must not be less than 4 or more than 20 characters");
}
if(pass.value.length < 8)
{
alert("Password must be atleast 8 characters");
}
if(name.value == "")
{
alert("Name field required ");
}
if(adress.value == "")
{
alert("Where do you stay?");
}
if(country.value == "")
{
alert("Must be from uganda stricly");
}
//zip code shoulb be numbers and symbols
if(zip.value == "")
{
alert("Whats your country's zip code");
}
/*email validation. i need the right formular for email adress, untill then , ill get back to jackson for help, alichan, julius, fred and james
if(email.value.length)
{
alert("");*/
if(sex.value == "")
{
alert("Pliz select your gender");
}
//this is still part of my validation. will update more when i add more languages.
if(Language.checked == true)
{
alert("Do you speak English? if diferent select non English");
}
if(about.value == "")
{
alert("Say something about yourself");
}
}
-->
</script>
<legend>
<center>
<fieldset>
<h2>Registration Form</h2>
<form name="myForm" action="" method="POST" onsubmit="validate();">
<table>
<tr>
<td><label for="Id">User Id :</label></td>
<td><input type="text" name="user" id="UserId"></td>
</tr>
<tr>
<td><label for="password">password :</label></td>
<td><input type="password" name="password" id="Password"></td>
</tr>
<tr>
<td><label for="name">Name :</label></td>
<td><input type="name" name="user name" id="Name"></td>
</tr>
<tr>
<td><label for="adress">Adress :</label></td>
<td><input type="text" name="user adress" id="Adress"></td>
</tr>
<tr>
<td><label for="country">Country :</label></td>
<td><input type="text" name="country" id="Country"></td>
</tr>
<tr>
<td><label for="ZIP code">ZIP code :</label></td>
<td><input type="text" name="zip code" id="Zipcode" placeholder="eg +256 is uganda's zipcode"></td>
</tr>
<tr>
<td><label for="email">Email :</label></td>
<td> <input type="email" name="email" id="Email"></td>
</tr>
<tr>
<td><label for="Id">Sex :</label></td>
</tr>
<tr>
<td><label for="radio button">Female </label></td>
<td><input type="radio" name="gender" id="Radio"></td>
</tr>
</tr>
<td><label for="radio button">Male </label></td>
<td><input type="radio" name="gender" id="Radio" ></td>
</tr>
<tr>
<td><label for="Id">Language :</label></td>
</tr>
<tr>
<td><label for="Id" type = "checkbox" >English </label></td>
<td><input type="checkbox" name="checkbox" id="English"></td>
</tr>
</tr>
<td> <label for="Id">Non English </label></td>
<td> <input type="checkbox" name="checkbox" id="Non English"></td>
</tr>
<!--<tr>
<td>Sex</td>
<td>
<label for="">Female</label>
<label for="">Male</label>
<input type="text" name="gender" id="">
<input type="text">
</td>
</tr>
-->
<tr>
<td><label for="textarea">About :</label></td>
<td><textarea name="text" id="text" cols="30" rows="10"></textarea></td>
</tr>
<td><label for="submit"></label></td>
<td><input type="submit" value="Submit" ></td>
</tr>
</table>
</form>
</fieldset>
</center>
</legend>
</body>
</html>