-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaynow.html
149 lines (125 loc) · 4.09 KB
/
paynow.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
<!DOCTYPE html>
<html>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="web.css">
<head>
<title></title>
</head>
<body class="gradient">
<section id="home">
<div class="container">
<div class="logo">
<h1>Fashion Girls</h1>
<H5>Where Every Girl Is A Fashionista</H5>
</div >
<div class="menu">
<ul class="meList">
<LI><a href="Index.html">Home</a></LI>
<li><a href ="hobbies.html">Hobbies </a></li>
<!-- <ul>
<li ><a href ="#">ballet </a></li>
<li><a href ="#">sport </a></li>
</ul> -->
<li><a href ="normal.html">Daily wear </a></li>
<!-- <ul>
<li><a href ="#">formal</a></li>
<li><a href ="#">casual </a></li>
<DIV class="pic"><img align="left" class= "one"src="images.jpeg"></p></DIV>
</ul> -->
<li><A href = "cart.html">cart</A></li>
<Li><a href= "about us.html">About Us </a></Li>
</ul>
</div>
</div>
<form>
<h5>Address</h5><br>
<input type="text" name="address" id="address" placeholder="street no/house no.etc"><br>
city<br>
<input type="text" name="city" id="city" placeholder="city"><br>
country<br>
<input type="text" name="country" id="country" placeholder="country"><br>
</form>
<h5>payment</h5>
<select id="pay" class="form-control">
<option value="pay" selected disabled>payment</option>
<option value="card">card</option>
<option value="cod">cash on delivery</option>
</select>
<div id="ifcard">
<button class="btn"><img class="visacard" src="visa.png"></button>
<button class="btn"><img class="mastercard" src="mastercard.png"></button>
<form>
<input type="text" name="card" id ="card" placeholder="card no.">
</form>
</div>
<div id = "if cod">
<form>
<input type="text" name="name" id ="name" placeholder="name "><br>
<input type="text" name="zip" id ="zip" placeholder="zip code "> <br>
<input type="text" name="num" id ="num" placeholder="phone number ">
</form>
</div>
<button class="btn btn-sm btn-dark " onclick="check()" >Pay Now
</button>
<script type="text/javascript">
var flag = 0;
function check() {
var a = document.getElementById("address");
var b = document.getElementById("city");
var c = document.getElementById("country");
var d = document.getElementById("pay")
var e = document.getElementById("name")
var f = document.getElementById("zip")
var g = document.getElementById("num")
var h = document.getElementById("card")
console.log(d.value)
if ( a.value == "") {
alert("please type address")
}
if (b.value == "") {
alert("please type city")
}
if (c.value == "") {
alert("please type country")
}
if (d.value == "pay") {
alert("please select a payment option")
}
if(flag == 0){
if(e.value == ""){
alert("please write your name")
}
if(f.value == ""){
alert("please write your zip number")
}
if(g.value == ""){
alert("please write your phone number")
}
}
if(flag == 1){
if(h.value == ""){
alert("please write your card number")
}
}
else{
window.location.href="thankyou.html"
}
}
document.getElementById('if cod').style.display = "none"
var pay =document.getElementById('pay');
pay.addEventListener('change',function(e){
var f = document.getElementById("card")
if (e.target.value=="card") {
document.getElementById("ifcard").style.display="block";
flag= 1;
document.getElementById('if cod').style.display = "none";
}else{
document.getElementById('ifcard').style.display = "none";
document.getElementById("if cod").style.display="block";
flag = 0;
}
});
</script>
</body>
</html>