-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscriptreport.js
More file actions
33 lines (28 loc) · 1.01 KB
/
Copy pathscriptreport.js
File metadata and controls
33 lines (28 loc) · 1.01 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
document.addEventListener('DOMContentLoaded', () => {
const form = document.getElementById('report-form');
const confirmation = document.getElementById('confirmation');
form.addEventListener('submit', (event) => {
event.preventDefault();
// Get form data
const formData = new FormData(form);
const name = formData.get('name');
const email = formData.get('email');
const issueType = formData.get('issue-type');
const description = formData.get('description');
// Here you would typically send the data to a server
console.log({
name,
email,
issueType,
description
});
// Show confirmation message
form.reset();
confirmation.classList.remove('hidden');
});
});
const goBackButton = document.getElementById('goBackButton');
goBackButton.addEventListener('click', () => {
// Go back in history
window.history.back();
});