-
Notifications
You must be signed in to change notification settings - Fork 0
/
oform.html
374 lines (307 loc) · 13.5 KB
/
oform.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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>oform</title>
<link rel="stylesheet" href="oformmain.css">
<script src="https://unpkg.com/scrollreveal"></script>
</head>
<body>
<div class="container">
<fieldset>
<legend align="center"> <h3> * If you want to rent your room/flat/pg fill the following details: </h3> </legend>
<form name="myform" action="thankyou.html" onsubmit="return validation()">
<div class="input1">
<label for="name">Flat Name</label>
<input type="text" id="name"><br>
<span id="flatname" style="color:red";></span>
</div><br><br>
<div class="input2">
<label for="location">Flat Location</label>
<input type="text" id="location"><br>
<span id="flatlocation" style="color:red"></span>
</div><br><br>
<div class="line1">
<div class="input3">
<label for="rent">Rent per head</label>
<input type="text" id="rent"><br><br>
<span id="renthead" style="color:red"></span>
</div>
<div class="input4">
Meal
<input type="radio" name="yes" value="yes" class="radio" id="yes">Yes
<input type="radio" name="yes" value="yes" class="radio" id="no">No
<br>
<span id="meals" style="color:red"></span>
</div>
</div><br>
<div class="line4">
<div class="input5">
<label for="bathroom" id="label">Bathroom</label>
<input type="text" id="bathroom"><br>
<span id="bath" style="color:red"></span>
</div>
<div class="inputd">
<label for="area" id="label">Area in sq/ft</label>
<input type="number" id="area">
</div>
</div><br><br>
<div class="line2">
<div class="input6">
<label for="bhk">BHK</label>
<input type="text" id="bhk"><br>
<span id="bhkk" style="color:red"></span>
</div>
<div class="input7">
<label for="date">Available from</label>
<input type="date" id="date">
</div>
</div><br><br>
<div class="line3">
<div class="input8">
<label>Subtype</label>
<select name="drop">
<option value="">None</option>
<option>PG</option>
<option>Hostel</option>
<option>Flat</option>
</select>
<br>
<span id="room" style="color:red"></span>
</div>
<div class="input9">
<label>Furnishing</label>
<select name="down" id="furny">
<option value="">None</option>
<option>Furnished</option>
<option>Semi-Furnished</option>
<option>Non-Furnished</option>
</select>
<br>
<span id="furn" style="color:red"></span>
</div>
</div><br><br>
<br>
<div class="inputa">
<label for="amenities">Amenities : </label>
<ul>
<li> <input type="checkbox" id="amenities" name="a" value="TV">TV</li>
<li> <input type="checkbox" id="amenities" name="b" value="AC">AC </li>
<li> <input type="checkbox" id="amenities" name="c" value="Wifi">WIFI </li>
</ul>
<ul>
<li> <input type="checkbox" id="amenities" name="d" value="Kitchen">KITCHEN </li>
<li><input type="checkbox" id="amenities" name="e" value="Fridge">FRIDGE </li>
<li> <input type="checkbox" id="amenities" name="f" value="Waching Machine">WASHING</li>
</ul>
<ul>
<li><input type="checkbox" id="amenities" name="g" value="Parking">PARKING </li>
<li> <input type="checkbox" id="amenities" name="h" value="CCTV">CCTV </li>
<li> <input type="checkbox" id="amenities" name="i" value="Lift">LIFT </li>
</ul>
</div><br><br>
<div class="inputb">
<label for="file">Upload your property here</label>
<input type="file" id="file">
</div><br><br>
<div class="inputc">
<label for="description">Add description here</label>
<Textarea name="b" rows="4" cols="50" id="description" value="description"></Textarea>
</div><br><br>
<button type="submit" class="submit">Submit</button>
<button type="submit">Back</button>
</form>
</fieldset>
</div>
<script>
ScrollReveal({
reset: true ,
distance: '60px',
duration: 2500,
delay: 500
});
ScrollReveal().reveal('.input1', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('.input2', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('.line1', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('.line2', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('.line3', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('.line4', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('.input9', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('.inputa', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('.inputb', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('.inputc', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('.inputd', { delay: 500, origin: 'bottom' });
ScrollReveal().reveal('fieldset', { delay: 500, origin: 'left' });
ScrollReveal().reveal('.container h3', { delay: 700, origin: 'top' });
ScrollReveal().reveal('.container button', { delay: 800, origin: 'bottom' });
</script>
<script>
function validation(){
var user=document.getElementById('name').value;
if(user == ""){
document.getElementById('flatname').innerHTML="*please fill this field*";
return false;
}
if((user.length<=2) || (user.length>30)){
document.getElementById('flatname').innerHTML="*length of flatname should be more than 2 chracters*";
return false;
}
if(/[`!@#$%^&*()+\=\[\]{};':"\\| .<>\/?~]/.test(user)){
document.getElementById('flatname').innerHTML="*no alphanumeric chracters and spaces are allowed in flatname**";
return false;
}
else{
document.getElementById('flatname').innerHTML="";
}
var loc=document.getElementById('location').value;
if(loc == ""){
document.getElementById('flatlocation').innerHTML="*please fill this field*";
return false;
}
if((loc.length<=2) || (loc.length>30)){
document.getElementById('flatlocation').innerHTML="**please fill this field";
return false;
}
if(/[`!@#$%^&*()+\=\[\]{};':"\\| .<>\/?~]/.test(loc)){
document.getElementById('flatlocation').innerHTML="*no alphanumeric chracters and spaces are allowed in flatname**";
return false;
}
else{
document.getElementById('flatlocation').innerHTML="";
}
var charge=document.getElementById('rent').value;
// if(charge<=999 || charge>100000){
// document.getElementById('renthead').innerHTML="** please enter between 1000 to 100000";
// return false;
// }
if(charge == ""){
document.getElementById('renthead').innerHTML="*please fill this field*";
return false;
}
if((charge<=999) || (charge>=100001)){
document.getElementById('renthead').innerHTML="*please enter between 1000 to 100000*";
return false;
}
if(/[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(charge)){
document.getElementById('renthead').innerHTML="*no alphanumeric chracters and spaces are allowed**";
return false;
}
if(isNaN(charge)){
document.getElementById('renthead').innerHTML="*only numbers are allowed**";
return false;
}
else{
document.getElementById('renthead').innerHTML="";
}
var bath=document.getElementById("bathroom").value;
if(bath==""){
document.getElementById('bath').innerHTML="**please enter the no.of bathrooms required";
return false;
}
if((bath<=0) || (bath>=10)){
document.getElementById('bath').innerHTML="*please enter below 10 number of bathrooms*";
return false;
}
if(/[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(bath)){
document.getElementById('bath').innerHTML="*no alphanumeric chracters and spaces are allowed**";
return false;
}
if(isNaN(bath)){
document.getElementById('bath').innerHTML="*only numbers are allowed**";
return false;
}
else{
document.getElementById('bath').innerHTML="";
}
var bhk=document.getElementById("bhk").value;
if(bhk==""){
document.getElementById('bhkk').innerHTML="**please enter a input";
return false;
}
if((bhk<=0) || (bhk>=6)){
document.getElementById('bhkk').innerHTML="*please enter below 6 number of BHK's*";
return false;
}
if(/[`!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/.test(bhk)){
document.getElementById('bhkk').innerHTML="*no alphanumeric chracters and spaces are allowed**";
return false;
}
if(isNaN(bhk)){
document.getElementById('bhkk').innerHTML="*only numbers are allowed**";
return false;
}
else{
document.getElementById('bhkk').innerHTML="";
}
const yes= document.querySelector('#yes');
const no= document.querySelector('#no');
if(yes.checked || no.checked){
// document.getElementById('meals').innerHTML="*please select any input**";
// return false;
document.getElementById('meals').innerHTML="";
}
else
{
// document.getElementById('meals').innerHTML="";
document.getElementById('meals').innerHTML="*please select any input**";
return false;
}
// var roomy = document.getElementById("roomy");
// var room = roomy.options[roomy.selectedIndex].value;
// var room1=roomy.options[roomy.selectedIndex].text;
// if(room1 == "None"){
// document.getElementById('room').innerHTML="*please select any input**";
// return false;
// }
// else
// {
// document.getElementById('room').innerHTML="";
// }
// if(document.getElementById('roomy').selectedIndex == 0)
// {
// document.getElementById('room').innerHTML="*please select any input**";
// return false;
// }
// else{
// document.getElementById('room').innerHTML="";
// }
var room = document.myform.drop.value;
if(room==""){
document.querySelector('#room').innerHTML="*please select any input**";
// alert("please select any value in SubType ");
return false;
}
else{
document.getElementById('room').innerHTML="";
}
var furn = document.myform.down.value;
// var furn = roomy.options[roomy.selectedIndex].value;
if(furn==""){
document.getElementById('furn').innerHTML="*please select any input**";
// alert("please select any value in Furnishing");
return false;
}
else{
document.getElementById('furn').innerHTML="";
}
// var roomy = document.getElementById("roomy").value;
// if(roomy==None){
// document.getElementById('room').innerHTML="*please select any input**";
// }
// else
// {
// document.getElementById('room').innerHTML="";
// }
// var furny = document.getElementById("furny").value;
// if(roomy==None){
// document.getElementById('furn').innerHTML="*please select any input**";
// }
// else
// {
// document.getElementById('furn').innerHTML="";
// }
}
</script>
</body>
</html>