-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathGDC-HomeJSnew.js
63 lines (61 loc) · 2.13 KB
/
GDC-HomeJSnew.js
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
var usernameSignUp=document.querySelector("#usernameSignUp").value;
var email=document.querySelector("#email").value;
var passSignUp=document.querySelector("#passSignUp").value;
var confPass=document.querySelector("#confpass").value;
var messageCheck1=document.querySelector("#messagecheck1");
var messageCheck2=document.querySelector("#messagecheck2");
var submitSignUp=document.querySelector("#submitSignUp");
submitSignUp.addEventListener("click", function(){
usernameSignUp=document.querySelector("#usernameSignUp").value;
email=document.querySelector("#email").value;
passSignUp=document.querySelector("#passSignUp").value;
confPass=document.querySelector("#confpass").value;
if(usernameSignUp==="" || email==="" || passSignUp==="" || confPass==="")
{
messageCheck1.innerHTML="All Fields Are Required";
if(passSignUp!=="" && confPass!=="" && passSignUp!==confPass)
{
messageCheck2.innerHTML="Password And Confirm Password Must Be Same";
}
}
else
{
messageCheck1.innerHTML="";
messagecheck2.innerHTML="";
if(passSignUp!==confPass)
{
messageCheck1.innerHTML="Password And Confirm Password Must Be Same";
}
else
{
messageCheck1.innerHTML="";
messagecheck2.innerHTML="";
alert("Thank You For Registering!!");
}
}
});
var ori=document.querySelector("#ori").value;
var destination=document.querySelector("#dest").value;
var departure=document.querySelector("#depart").value;
var ret=document.querySelector("#return").value;
var flightsButton=document.querySelector("#flightsButton");
flightsButton.addEventListener("click",function(){
var ori=document.querySelector("#ori").value;
var destination=document.querySelector("#dest").value;
var departure=document.querySelector("#depart").value;
var ret=document.querySelector("#return").value;
var dl=parseInt(departure.substring(8,10));
var rl=parseInt(ret.substring(8,10));
if(ori==="Origin")
{
alert("Select Proper Origin");
}
else if(destination==="Destination")
{
alert("Select Proper Destination");
}
else if(departure===""||ret===""||dl>rl||dl<24||rl<24)
{
alert("Enter Proper Dates");
}
});