Time Off Request Form

This comprehensive time off request form streamlines the leave approval process for organizations of all sizes. The form captures leave type (vacation, sick, personal, etc.), date range with automatic day calculation, coverage arrangements, and optional comments. Dynamic validation ensures proper notice periods and prevents duplicate requests, while the summary provides clear confirmation for both employees and managers.

Employee Experience

Try the Form

Submit your leave request for manager approval
Employee Information
 
 
 
Leave Details
 
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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
export function timeOffRequestForm(form: FormTs) {
// Time Off Request Form - Employee PTO/Leave Request
// Demonstrates: Datepicker, Dropdown, RadioButton, Computed Values, Multi-page Wizard, Dynamic Styling
 
// ============================================
// HEADER
// ============================================
form.addRow(row => {
row.addTextPanel('header', {
label: 'Time Off Request',
computedValue: () => 'Submit your leave request for manager approval',
customStyles: {
backgroundColor: '#4f46e5',
color: 'white',
padding: '24px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
 
// ============================================
// SECTION 1: Employee Information
// ============================================
const employeeSection = form.addSubform('employeeSection', {
title: 'Employee Information'
});
 
employeeSection.addRow(row => {
row.addTextbox('employeeName', {
label: 'Your Name',
placeholder: 'Full name',
isRequired: true
}, '1fr');
row.addTextbox('employeeId', {
label: 'Employee ID',
placeholder: 'e.g., EMP-1234'
}, '200px');
});
 
employeeSection.addRow(row => {
row.addDropdown('department', {
label: 'Department',
placeholder: 'Select your department',
options: [
{ id: 'engineering', name: 'Engineering' },
{ id: 'product', name: 'Product' },
{ id: 'design', name: 'Design' },
{ id: 'marketing', name: 'Marketing' },
{ id: 'sales', name: 'Sales' },
{ id: 'hr', name: 'Human Resources' },
{ id: 'finance', name: 'Finance' },
{ id: 'operations', name: 'Operations' },
{ id: 'customer-success', name: 'Customer Success' },
{ id: 'legal', name: 'Legal' },
{ id: 'other', name: 'Other' }
],
isRequired: true
}, '1fr');
row.addTextbox('managerName', {
label: 'Manager Name',
placeholder: 'Your direct manager'
}, '1fr');
});
 
// ============================================
// SECTION 2: Leave Details
// ============================================
const leaveSection = form.addSubform('leaveSection', {
title: 'Leave Details',
customStyles: { backgroundColor: '#f8fafc', padding: '16px', borderRadius: '8px' }
});
 
leaveSection.addRow(row => {
row.addRadioButton('leaveType', {
label: 'Type of Leave',
options: [
{ id: 'vacation', name: 'Vacation / PTO' },
{ id: 'sick', name: 'Sick Leave' },
{ id: 'personal', name: 'Personal Day' },
{ id: 'bereavement', name: 'Bereavement' },
{ id: 'jury-duty', name: 'Jury Duty' },
{ id: 'parental', name: 'Parental Leave' },
{ id: 'medical', name: 'Medical Leave' },
{ id: 'unpaid', name: 'Unpaid Leave' },
{ id: 'other', name: 'Other' }
],
orientation: 'vertical',
isRequired: true
});
});
 
// Show text input for other leave type
leaveSection.addRow(row => {
row.addTextbox('otherLeaveType', {
label: 'Please specify leave type',
placeholder: 'Describe the type of leave',
isVisible: () => leaveSection.radioButton('leaveType')?.value() === 'other',
isRequired: () => leaveSection.radioButton('leaveType')?.value() === 'other'
});
});
 
// ============================================
// SECTION 3: Date Range
// ============================================
const dateSection = form.addSubform('dateSection', {
title: 'Time Period',
isVisible: () => !!leaveSection.radioButton('leaveType')?.value()
});
 
dateSection.addRow(row => {
row.addDatepicker('startDate', {
label: 'Start Date',
isRequired: true
}, '1fr');
row.addDatepicker('endDate', {
label: 'End Date',
isRequired: true
}, '1fr');
});
 
dateSection.addRow(row => {
row.addRadioButton('dayType', {
label: 'Day Type',
options: [
{ id: 'full', name: 'Full Day(s)' },
{ id: 'half-am', name: 'Half Day (Morning)' },
{ id: 'half-pm', name: 'Half Day (Afternoon)' }
],
orientation: 'horizontal'
});
});
 
// Day count display
dateSection.addRow(row => {
row.addTextPanel('dayCount', {
computedValue: () => {
const start = dateSection.datepicker('startDate')?.value();
const end = dateSection.datepicker('endDate')?.value();
const dayType = dateSection.radioButton('dayType')?.value();
 
if (!start || !end) return '';
 
const startDate = new Date(start);
const endDate = new Date(end);
 
if (endDate < startDate) {
return 'End date must be after start date';
}
 
// Calculate business days (simplified - doesn't account for holidays)
let days = 0;
const current = new Date(startDate);
while (current <= endDate) {
const dayOfWeek = current.getDay();
if (dayOfWeek !== 0 && dayOfWeek !== 6) {
days++;
}
current.setDate(current.getDate() + 1);
}
 
if (dayType === 'half-am' || dayType === 'half-pm') {
days = days * 0.5;
}
 
const dayWord = days === 1 ? 'day' : 'days';
return `Total: ${days} business ${dayWord} requested`;
},
customStyles: () => {
const start = dateSection.datepicker('startDate')?.value();
const end = dateSection.datepicker('endDate')?.value();
 
if (!start || !end) return { display: 'none' };
 
const startDate = new Date(start);
const endDate = new Date(end);
 
if (endDate < startDate) {
return {
backgroundColor: '#fee2e2',
color: '#dc2626',
padding: '12px',
borderRadius: '8px',
textAlign: 'center',
fontWeight: 'bold'
};
}
 
return {
backgroundColor: '#dbeafe',
color: '#1d4ed8',
padding: '12px',
borderRadius: '8px',
textAlign: 'center',
fontWeight: 'bold'
};
},
isVisible: () => !!dateSection.datepicker('startDate')?.value() && !!dateSection.datepicker('endDate')?.value()
});
});
 
// ============================================
// SECTION 4: Coverage & Handoff
// ============================================
const coverageSection = form.addSubform('coverageSection', {
title: 'Coverage Arrangements',
isVisible: () => {
const leaveType = leaveSection.radioButton('leaveType')?.value();
const start = dateSection.datepicker('startDate')?.value();
// Only show for vacation/personal and if dates are selected
return (leaveType === 'vacation' || leaveType === 'personal') && !!start;
}
});
 
coverageSection.addRow(row => {
row.addRadioButton('hasCoverage', {
label: 'Have you arranged coverage for your responsibilities?',
options: [
{ id: 'yes', name: 'Yes, coverage is arranged' },
{ id: 'not-needed', name: 'Not needed - no urgent tasks' },
{ id: 'in-progress', name: 'Working on it' },
{ id: 'need-help', name: 'Need help arranging' }
],
orientation: 'vertical'
});
});
 
coverageSection.addRow(row => {
row.addTextbox('coveringPerson', {
label: 'Who will cover your responsibilities?',
placeholder: 'Name of colleague(s)',
isVisible: () => coverageSection.radioButton('hasCoverage')?.value() === 'yes'
});
});
 
coverageSection.addSpacer();
coverageSection.addRow(row => {
row.addTextarea('handoffNotes', {
label: 'Handoff notes (optional)',
placeholder: 'Key tasks, pending items, important contacts...',
rows: 3,
autoExpand: true,
isVisible: () => coverageSection.radioButton('hasCoverage')?.value() === 'yes'
});
});
 
// ============================================
// SECTION 5: Reason/Details (for specific leave types)
// ============================================
const reasonSection = form.addSubform('reasonSection', {
title: 'Additional Details',
isVisible: () => {
const leaveType = leaveSection.radioButton('leaveType')?.value();
return leaveType === 'medical' || leaveType === 'bereavement' || leaveType === 'other';
}
});
 
reasonSection.addRow(row => {
row.addTextarea('leaveReason', {
label: () => {
const leaveType = leaveSection.radioButton('leaveType')?.value();
if (leaveType === 'medical') return 'Brief description (medical details are optional and confidential)';
if (leaveType === 'bereavement') return 'Relationship to deceased (optional)';
return 'Additional details';
},
placeholder: 'This information is confidential...',
rows: 2,
autoExpand: true
});
});
 
// ============================================
// SECTION 6: Contact During Leave
// ============================================
const contactSection = form.addSubform('contactSection', {
title: 'Contact Information',
isVisible: () => !!dateSection.datepicker('startDate')?.value()
});
 
contactSection.addRow(row => {
row.addRadioButton('emergencyContact', {
label: 'Can you be reached for emergencies during your leave?',
options: [
{ id: 'yes', name: 'Yes - for true emergencies only' },
{ id: 'limited', name: 'Limited availability' },
{ id: 'no', name: 'No - completely unavailable' }
],
orientation: 'vertical'
});
});
 
contactSection.addRow(row => {
row.addTextbox('emergencyPhone', {
label: 'Emergency Contact Number (optional)',
placeholder: 'Phone number for emergencies',
isVisible: () => {
const contact = contactSection.radioButton('emergencyContact')?.value();
return contact === 'yes' || contact === 'limited';
}
});
});
 
// ============================================
// SECTION 7: Acknowledgment
// ============================================
const ackSection = form.addSubform('ackSection', {
title: 'Acknowledgment',
isVisible: () => !!dateSection.datepicker('startDate')?.value()
});
 
ackSection.addRow(row => {
row.addCheckbox('policyAck', {
label: 'I confirm this request complies with company leave policies',
isRequired: true
});
});
 
ackSection.addRow(row => {
row.addCheckbox('noticeAck', {
label: () => {
const leaveType = leaveSection.radioButton('leaveType')?.value();
if (leaveType === 'vacation' || leaveType === 'personal') {
return 'I understand this request requires manager approval and adequate notice';
}
return 'I understand this request will be reviewed by my manager';
},
isRequired: true
});
});
 
// ============================================
// SECTION 8: Summary
// ============================================
const summarySection = form.addSubform('summary', {
title: 'Request Summary',
isVisible: () => ackSection.checkbox('policyAck')?.value() === true
});
 
summarySection.addRow(row => {
row.addTextPanel('summaryContent', {
computedValue: () => {
const name = employeeSection.textbox('employeeName')?.value();
const department = employeeSection.dropdown('department')?.value();
const leaveType = leaveSection.radioButton('leaveType')?.value();
const start = dateSection.datepicker('startDate')?.value();
const end = dateSection.datepicker('endDate')?.value();
const dayType = dateSection.radioButton('dayType')?.value();
const coverage = coverageSection.radioButton('hasCoverage')?.value();
 
if (!name || !leaveType || !start) return '';
 
const leaveLabels: Record<string, string> = {
'vacation': 'Vacation / PTO',
'sick': 'Sick Leave',
'personal': 'Personal Day',
'bereavement': 'Bereavement',
'jury-duty': 'Jury Duty',
'parental': 'Parental Leave',
'medical': 'Medical Leave',
'unpaid': 'Unpaid Leave',
'other': 'Other'
};
 
const deptLabels: Record<string, string> = {
'engineering': 'Engineering',
'product': 'Product',
'design': 'Design',
'marketing': 'Marketing',
'sales': 'Sales',
'hr': 'Human Resources',
'finance': 'Finance',
'operations': 'Operations',
'customer-success': 'Customer Success',
'legal': 'Legal',
'other': 'Other'
};
 
// Calculate days
let dayCount = 0;
if (start && end) {
const startDate = new Date(start);
const endDate = new Date(end);
const current = new Date(startDate);
while (current <= endDate) {
const dayOfWeek = current.getDay();
if (dayOfWeek !== 0 && dayOfWeek !== 6) {
dayCount++;
}
current.setDate(current.getDate() + 1);
}
if (dayType === 'half-am' || dayType === 'half-pm') {
dayCount = dayCount * 0.5;
}
}
 
let summary = '📋 Time Off Request\n';
summary += `${'═'.repeat(25)}\n\n`;
summary += `👤 Employee: ${name}\n`;
if (department) {
summary += `🏢 Department: ${deptLabels[department] || department}\n`;
}
summary += `\n📅 Leave Type: ${leaveLabels[leaveType] || leaveType}\n`;
summary += `📆 From: ${start}\n`;
if (end) {
summary += `📆 To: ${end}\n`;
}
if (dayCount > 0) {
const dayWord = dayCount === 1 ? 'day' : 'days';
summary += `\n⏱️ Duration: ${dayCount} business ${dayWord}\n`;
}
 
if (coverage) {
const coverageLabels: Record<string, string> = {
'yes': '✅ Coverage arranged',
'not-needed': '📝 No coverage needed',
'in-progress': '🔄 Arranging coverage',
'need-help': '❓ Needs assistance'
};
summary += `\n${coverageLabels[coverage] || ''}`;
}
 
summary += '\n\n⏳ Status: Pending Approval';
 
return summary;
},
customStyles: {
padding: '16px',
borderRadius: '8px',
backgroundColor: '#f0f9ff',
borderLeft: '4px solid #3b82f6',
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
fontSize: '14px'
}
});
});
 
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Submit Request',
isVisible: () => {
return ackSection.checkbox('policyAck')?.value() === true &&
ackSection.checkbox('noticeAck')?.value() === true;
}
});
 
form.configureCompletionScreen({
type: 'text',
title: 'Request Submitted Successfully!',
message: 'Your time off request has been submitted and is pending manager approval. You will receive an email notification once your request has been reviewed. For urgent matters, please contact your manager directly.'
});
}
 

Frequently Asked Questions

Can I customize the leave types?

Yes. The form includes common leave types (vacation, sick, personal, bereavement, etc.) that you can modify, add to, or remove based on your organization's policies and regional requirements.

How does the day calculation work?

The form automatically calculates the number of working days between the start and end dates. You can customize this to include or exclude weekends and company holidays based on your policy.

Can employees see their remaining balance?

The form template can be extended to integrate with your HR system to display real-time PTO balance. This requires connecting to your time-off tracking database or API.

How do I set up manager notifications?

The form can be configured to send email notifications to the employee's manager upon submission. You can customize the notification template and add escalation rules for extended leave requests.

Can I require minimum advance notice?

Yes. The form includes validation for advance notice periods. You can set different requirements for different leave types (e.g., 2 weeks for vacation, same-day for sick leave).