-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformScript.js
More file actions
22 lines (19 loc) · 1014 Bytes
/
formScript.js
File metadata and controls
22 lines (19 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Assuming this is the script for your form submission (formScript.js or similar)
document.getElementById('medicalForm').addEventListener('submit', function(e) {
e.preventDefault();
const formData = {
name: document.getElementById('name').value,
age: document.getElementById('age').value,
sex: document.getElementById('sex').value,
bloodGroup: document.getElementById('bloodGroup').value,
medications: document.getElementById('medications').value,
chronicConditions: document.getElementById('chronicConditions').value,
emergencyContactName: document.getElementById('emergencyContactName').value,
emergencyContactPhone: document.getElementById('emergencyContactPhone').value,
allergies: document.getElementById('allergies').value
};
// Store data in localStorage
localStorage.setItem('formData', JSON.stringify(formData));
// Redirect to the format selection page
window.location.href = 'selectFormat.html';
});