-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.js
31 lines (24 loc) · 1.18 KB
/
options.js
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
function updateSelectedOptions() {
const selectElement = document.getElementById('loginOptions');
const selectedOptionsContainer = document.getElementById('selectedOptionsContainer');
const selectedOptions = Array.from(selectElement.selectedOptions).map(option => option.value);
selectedOptionsContainer.innerHTML = ''; // Clear previous content
if (selectedOptions.length > 0) {
selectedOptions.forEach(option => {
const optionBox = document.createElement('div');
optionBox.className = 'selected-option-box';
optionBox.textContent = option;
selectedOptionsContainer.appendChild(optionBox);
});
}
}
function submitForm() {
const name = document.getElementById("name").value;
const email = document.getElementById("email").value;
const message = document.getElementById("message").value;
// Perform validation here if needed
// Simulate sending data to a server (you can replace this with actual AJAX request)
setTimeout(() => {
document.getElementById("response").innerHTML = `<p>Thank you, ${name}! Your message has been sent.</p>`;
}, 1000);
}