-
Notifications
You must be signed in to change notification settings - Fork 0
/
same_as_above.html
148 lines (113 loc) · 5.39 KB
/
same_as_above.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 lang="en">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-4">
<h3 class="text-primary">Permanent Address</h3>
<p>Enter permanent address as your Identity card</p>
<!--=== Permanent address=== -->
<div class="form-group">
<input type="text" class="form-control" placeholder="Address Line 1" id="pAddressLine1">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Address Line 2" id="pAddressLine2">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Landmark" id="pLandmark">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Zip Code" id="pZipcode">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="City" id="pCity">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="State" id="pState">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="country" id="pCountry">
</div>
<!--=== Permanent address=== -->
</div>
<div class="col-sm-4">
<h3 class="text-primary">Current Address</h3>
<div class="form-group">
<input type="checkbox" id="checkBox" onclick="autoFilAddress()"> Same as permanent address
</div>
<!--=== current address=== -->
<div class="form-group">
<input type="text" class="form-control" placeholder="Address Line 1" id="curAddressLine1">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Address Line 2" id="curAddressLine2">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Landmark" id="curLandmark">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Zip Code" id="curZipcode">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="City" id="curCity">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="State" id="curState">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="country" id="curCountry">
</div>
<!--=== current address=== -->
</div>
<div class="col-sm-4"></div>
</div>
</div>
<script type="text/javascript">
function autoFilAddress() {
let checkBox = document.getElementById('checkBox');
let pAddressLine1 = document.getElementById("pAddressLine1");
let pAddressLine2 = document.getElementById("pAddressLine2");
let pLandmark = document.getElementById("pLandmark");
let pZipcode = document.getElementById("pZipcode");
let pCity = document.getElementById("pCity");
let pState = document.getElementById("pState");
let pCountry = document.getElementById("pCountry");
let curAddressLine1 = document.getElementById("curAddressLine1");
let curAddressLine2 = document.getElementById("curAddressLine2");
let curLandmark = document.getElementById("curLandmark");
let curZipcode = document.getElementById("curZipcode");
let curCity = document.getElementById("curCity");
let curState = document.getElementById("curState");
let curCountry = document.getElementById("curCountry");
if (checkBox.checked == true) {
let pAddressLine1Value = pAddressLine1.value;
let pAddressLine2Value = pAddressLine2.value;
let pLandmarkValue = pLandmark.value;
let pZipcodeValue = pZipcode.value;
let pCityValue = pCity.value;
let pStateValue = pState.value;
let pCountryValue = pCountry.value;
curAddressLine1.value = pAddressLine1Value;
curAddressLine2.value = pAddressLine2Value;
curLandmark.value = pLandmarkValue;
curZipcode.value = pZipcodeValue;
curCity.value = pCityValue;
curState.value = pStateValue;
curCountry.value = pCountryValue;
}
else {
curAddressLine1.value = "";
curAddressLine2.value = "";
curLandmark.value = "";
curZipcode.value = "";
curCity.value = "";
curState.value = "";
curCountry.value = "";
}
}
</script>
</body>
</html>