-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
404 lines (393 loc) · 17.7 KB
/
index.html
File metadata and controls
404 lines (393 loc) · 17.7 KB
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
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Job Form Example - FormKiQ Core Web Form Handler</title>
<link href="https://unpkg.com/tailwindcss/dist/base.min.css" rel="stylesheet">
<link href="https://unpkg.com/tailwindcss/dist/components.min.css" rel="stylesheet">
<link href="https://unpkg.com/@tailwindcss/custom-forms/dist/custom-forms.min.css" rel="stylesheet">
<link href="https://unpkg.com/tailwindcss/dist/utilities.min.css" rel="stylesheet">
</head>
<body>
<div class="max-h-screen h-screen mx-4 my-4">
<section>
<div class="md:flex md:items-center mx-4 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
</div>
<div class="md:w-2/3 lg:w-1/2">
<h1 class="text-2xl tracking-tight leading-10 font-extrabold text-gray-900 sm:leading-none md:text-3xl mb-4">
Job Form Example - Apply for This Fake Position
</h1>
<h2 class="text-xl tracking-tight leading-10 font-extrabold text-gray-900 sm:leading-none md:text-2xl mb-8">
(FormKiQ Core Web Form Handler)
</h2>
</div>
</div>
<form name="Job Form" class="fkq-form">
<div class="md:flex md:items-center mx-4 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
<label class="block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4" for="firstName">
First Name
</label>
</div>
<div class="md:w-2/3 lg:w-1/2">
<input
aria-label="First Name"
name="firstName"
type="text"
class="appearance-none rounded-md relative block w-full px-3 py-3 border border-gray-600
placeholder-gray-500 text-gray-900 rounded-t-md
focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-xl sm:leading-5"
placeholder="Jan"
/>
</div>
</div>
<div class="md:flex md:items-center mx-4 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
<label class="block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4" for="lastName">
Last Name
</label>
</div>
<div class="md:w-2/3 lg:w-1/2">
<input
aria-label="Last Name"
name="lastName"
type="text"
class="appearance-none rounded-md relative block w-full px-3 py-3 border border-gray-600
placeholder-gray-500 text-gray-900 rounded-t-md
focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-xl sm:leading-5"
placeholder="Doe"
/>
</div>
</div>
<div class="md:flex md:items-center mx-4 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
<label class="block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4" for="email">
Email Address
</label>
</div>
<div class="md:w-2/3 lg:w-1/2">
<input
aria-label="Email Address"
name="email"
type="email"
class="appearance-none rounded-md relative block w-full px-3 py-3 border border-gray-600
placeholder-gray-500 text-gray-900 rounded-t-md
focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-xl sm:leading-5"
placeholder="me@mycompany.com"
/>
</div>
</div>
<div class="md:flex md:items-center mx-4 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
<label class="block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4" for="country">
Country
</label>
</div>
<div class="md:w-2/3 lg:w-1/2">
<select
aria-label="Country"
name="country"
class="appearance-none rounded-md relative block w-full px-3 py-3 border border-gray-600
placeholder-gray-500 text-gray-900 rounded-t-md
focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-xl sm:leading-5"
>
<option value="bi">
Burundi
</option>
<option value="it">
Italy
</option>
<option value="uy">
Uruguay
</option>
</select>
</div>
</div>
<div class="md:flex md:items-center mx-4 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
<label class="block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4" for="positionType">
Type of Position Desired
</label>
</div>
<div class="md:w-2/3 lg:w-1/2">
<div class="block md:inline">
<input
type="checkbox"
id="positionType-fullTime"
aria-label="Type of Position Desired: Full Time"
name="positionType"
value="Full Time"
class="form-checkbox h-5 w-5 text-blue-500"
/>
<label class="ml-2 cursor-pointer text-gray-700 font-bold" for="positionType-fullTime">Full Time</span>
</div>
<div class="block md:inline">
<input
type="checkbox"
id="positionType-partTime"
aria-label="Type of Position Desired: Part Time"
name="positionType"
value="Part Time"
class="md:ml-6 form-checkbox h-5 w-5 text-blue-500"
/>
<label class="ml-2 cursor-pointer text-gray-700 font-bold" for="positionType-partTime">Part Time</span>
</div>
</div>
</div>
<div class="md:flex md:items-center mx-4 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
<label class="block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4" for="willingToRelocate">
Are You Willing to Relocate to New York City?
</label>
</div>
<div class="md:w-2/3 lg:w-1/2">
<div class="block md:inline">
<input
type="radio"
id="willingToRelocate-yes"
aria-label="Willing to Relocate: Yes"
name="willingToRelocate"
value="Yes"
class="form-radio h-5 w-5 text-blue-500"
/>
<label class="ml-2 cursor-pointer text-gray-700 font-bold" for="willingToRelocate-yes">Yes</span>
</div>
<div class="block md:inline">
<input
type="radio"
id="willingToRelocate-no"
aria-label="Willing to Relocate: No"
name="willingToRelocate"
value="No"
class="md:ml-6 form-radio h-5 w-5 text-blue-500"
/>
<label class="ml-2 cursor-pointer text-gray-700 font-bold" for="willingToRelocate-no">No</span>
</div>
</div>
</div>
<div class="md:flex md:items-center mx-4 mt-8 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
<label class="block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4" for="resume">
Your Resume
<span class="block text-sm">(Word, PDF, Plain Text)</span>
</label>
</div>
<div class="md:w-2/3 lg:w-1/2">
<div class="mt-4 mb-4">
<div class="md:flex md:flex-columns">
<div
onclick="openFileInput('resumeFileInput')"
class="bg-blue-600 hover:bg-blue-500 text-white font-bold py-2 px-4 md:w-1/2 inline-flex items-center"
>
<svg fill="#FFF" height="18" viewBox="0 0 24 24" width="18" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"/>
</svg>
<span id="resumeFileInputText" class="ml-2">Upload Resume</span>
</div>
<div class="md:w-1/2 pl-2 mt-2 md:mt-0">
<div
id="resumeSelectedFileText"
class="py-2 relative pl-1 pr-6"
>
<input
aria-label="Your Resume"
id="resumeFileInput"
name="resume"
type="file"
class="cursor-pointer absolute w-1 h-1 block opacity-0 pin-r pin-t"
onchange="displaySelectedFile(this, 'resume')"
/>
<span>
(no file selected)
</span>
<div
id="resumeRemoveFileButton"
class="hidden cursor-pointer absolute top-0 mt-2 right-0 w-6 h-6 bg-red-600 hover:bg-red-500 text-white font-bold py-2 px-3 inline-flex justify-center items-center"
onclick="removeSelectedFile('resumeFileInput', 'resume')"
>
X
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="md:flex md:items-center mx-4 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
<label class="block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4" for="coverLetter">
Your Cover Letter
<span class="block text-sm">(optional)</span>
</label>
</div>
<div class="md:w-2/3 lg:w-1/2">
<div class="mt-4 mb-4">
<div class="md:flex md:flex-columns">
<div
onclick="openFileInput('coverLetterFileInput')"
class="bg-blue-600 hover:bg-blue-500 text-white font-bold py-2 px-4 md:w-1/2 inline-flex items-center"
>
<svg fill="#FFF" height="18" viewBox="0 0 24 24" width="18" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M9 16h6v-6h4l-7-7-7 7h4zm-4 2h14v2H5z"/>
</svg>
<span id="coverLetterFileInputText" class="ml-2">Upload Cover Letter</span>
</div>
<div class="md:w-1/2 pl-2 mt-2 md:mt-0">
<div
id="coverLetterSelectedFileText"
class="py-2 relative pl-1 pr-6"
>
<input
aria-label="Your Cover Letter"
id="coverLetterFileInput"
name="coverLetter"
type="file"
class="cursor-pointer absolute w-1 h-1 block opacity-0 pin-r pin-t"
onchange="displaySelectedFile(this, 'coverLetter')"
/>
<span>
(no file selected)
</span>
<div
id="coverLetterRemoveFileButton"
class="hidden cursor-pointer absolute top-0 mt-2 right-0 w-6 h-6 bg-red-600 hover:bg-red-500 text-white font-bold py-2 px-3 inline-flex justify-center items-center"
onclick="removeSelectedFile('coverLetterFileInput', 'coverLetter')"
>
X
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="md:flex md:items-center mx-4 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
<label class="block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4" for="interestingFact">
Tell us something interesting or unusual about yourself
</label>
</div>
<div class="md:w-2/3 lg:w-1/2">
<textarea
aria-label="An Interesting Fact about Yourself"
name="interestingFact"
class="appearance-none rounded-md relative block w-full px-3 py-3 border border-gray-600
placeholder-gray-500 text-gray-900 rounded-t-md
focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-xl sm:leading-5"
></textarea>
</div>
</div>
<div class="md:flex md:items-center mx-4 mt-8 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
</div>
<div class="md:w-2/3 lg:w-1/2">
<input
type="submit"
class="w-full cursor-pointer bg-green-600 hover:bg-green-500 text-white font-bold py-2 px-3 inline-flex justify-center items-center"
value="Submit Your Fake Application"
/>
</div>
</div>
<div id="response" class="hidden">
<div class="md:flex md:items-center mx-4 mt-8 mb-4 relative">
<div class="md:w-1/3 lg:w-1/4">
</div>
<div class="md:w-2/3 lg:w-1/2">
<h2 class="text-xl tracking-tight leading-10 font-extrabold text-gray-900 sm:leading-none md:text-2xl mb-8">
Your application has been received. Thank you!
</h2>
</div>
</div>
</div>
</form>
</section>
</div>
<script type="text/javascript" src="./node_modules/formkiq-client-sdk-javascript/dist/web-cjs/formkiq-client-sdk-cjs.js"></script>
<script type="text/javascript">
let formkiqClient;
window.onload = () => {
/*
* In order to auto-wire form or submit manually to the FormKiQ Core API,
* you must create an instance of FormkiqClient
*
* NOTE: you must replace "<ID>" and "<REGION>" with the ID and Region in your
* FormKiQ Core HTTP API URL, which can be found in your CloudFormation Outputs
* (see https://github.com/formkiq/formkiq-core#cloudformation-outputs)
*/
formkiqClient = new FormkiqClient('<ID>.execute-api.<REGION>.amazonaws.com');
}
/*
* You can submit the form manually using this function.
*
* NOTE: if you want to add an onsubmit attribute to your form, be sure to
* append "return false;" after your onsubmit code, to prevent the page submitting.
*/
function submitForm(thisForm) {
// only needed for manual form submitting
formkiqClient.webFormsHandler.submitFormkiqForm(thisForm);
}
function onFormSubmitted(formName) {
// this event is fired when the form has been submitted
console.log(`${formName} has been submitted for processing.`);
}
function onFormCompleted(formName, response) {
// this event is fired when the form processing has been completed
console.log(`${formName} has been received and processed. Response below:`);
console.log(response);
var responseDiv = document.getElementById('response');
if (responseDiv) {
responseDiv.classList.remove('hidden');
window.scrollBy(0, 200);
}
}
/*** FILE INPUT FIELD FUNCTIONS ***/
/*
* NOTE: these three functions below are specific to the input fields used in this form,
* and are not part of the FormKiQ Core or Client SDK requirements
*/
function openFileInput(fileInputId) {
var fileInput = document.getElementById(fileInputId);
if (fileInput) {
fileInput.click();
}
}
function displaySelectedFile(fileInput, idPrefix) {
var fileName = fileInput.value;
if (fileName.indexOf('\\')) {
fileName = fileName.substr(fileName.lastIndexOf('\\') + 1);
}
var selectedFileNameDisplayContainer = document.getElementById(idPrefix + 'SelectedFileText');
if (selectedFileNameDisplayContainer) {
var selectedFileNameDisplaySpan = Array.from(
selectedFileNameDisplayContainer.getElementsByTagName('SPAN')
).shift();
selectedFileNameDisplaySpan.innerText = fileName;
}
var removeButton = document.getElementById(idPrefix + 'RemoveFileButton');
var fileInputButtonText = document.getElementById(idPrefix + 'FileInputText');
if (removeButton) {
if (fileName.length) {
removeButton.classList.remove('hidden');
if (fileInputButtonText) {
fileInputButtonText.innerText = fileInputButtonText.innerText.replace('Upload', 'Replace');
}
} else {
removeButton.classList.add('hidden');
if (fileInputButtonText) {
fileInputButtonText.innerText = fileInputButtonText.innerText.replace('Replace', 'Upload');
}
}
}
}
function removeSelectedFile(fileInputId, idPrefix) {
var fileInput = document.getElementById(fileInputId);
if (fileInput) {
fileInput.value = '';
}
displaySelectedFile(fileInput, idPrefix);
}
</script>
</body>
</html>