-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
119 lines (113 loc) · 3.34 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
<!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">
<link rel="stylesheet" href="css/style.css">
<script type="text/jquery" src="js/script.js"></script>
<link rel="shortcut icon" href="./img/small_maple.png">
<title>Jurisdiction Finder</title>
</head>
<header>
<div class="black_band">
<img src="./img/small_logo.PNG" alt="small">
</div>
<div class="head">
<h1>Jurisdiction Finder</h1>
<img src="./img/maple leaf.png" alt="maple" class="img_1">
<img src="./img/government_logo.png" alt="government_logo" class="img_2">
</div>
<style>
#suggestions{
position: absolute;
background:white;
outline:1px solid black;
margin-left: 10%;
}
</style>
</header>
<body>
<div id="container1" class="container">
<section class="page_1 head">
<h1>Welcome to the Jurisdiction Finder</h1>
<p>Please type in your employer's name. Make sure it is the company's registered legal name.
If you do not have your employer's name, type in it's registered business number if applicable.
</p>
<form action="checkcompany.php" target="_self" method="GET">
<input id="employerName" type="text" name="employer">
<ul id="suggestions" hidden>
</ul>
<br>
<button type="button" id="submitButton">SUBMIT</button>
</form>
</section>
</div>
</body>
<script
src="https://code.jquery.com/jquery-3.3.1.js"
integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
crossorigin="anonymous"></script>
<script>
$(function(){
$("#submitButton").click(function(){
var val = $("#employerName").val();
$.ajax({
method:'GET',
url: 'checkcompany.php?employer=' + val,
dataType: 'json',
success: function(data){
if(data.success == "true"){
//redirect to next page
if(data.federal == "yes"){
window.location.href = "federal_response_1.html";
}
else if(data.federal == "maybe"){
window.location.href = "federal_response_1.html";
}
else {
window.location.href = "question_1.php?employer=" + val;
}
}
else {
//some sort of error on the server that will be handled later
}
}
})
})
$("#suggestion").css("left", $("#employerName").offset().left);
$("#employerName").keyup(function(){
var curr = $("#employerName").val();
$.ajax({
method:'GET',
url: 'getcompanylist.php?q=' + curr,
dataType: 'json',
async:'false',
success: function(data){
if(data.length > 0){
$("#suggestions").html("");
$.each(data, function(i, val){
$("#suggestions").append('<li class="clickable-suggestion">' + data[i] + '</li>');
})
$("li").click(function(){
var val = $(this).html();
console.log("CLICKED: " + val);
$("#employerName").val(val);
})
$("#suggestions").show();
}
else{
$("#suggestions").html("");
$("#suggestions").hide();
}
}
})
})
});
</script>
<footer>
<div>
<p><b>Canada.ca</b></p>
</div>
</footer>
</html>