-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
35 lines (28 loc) · 1.03 KB
/
script.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
32
33
34
35
// Get modal elements
var modal = document.getElementById("customerFormModal");
var buyNowBtn = document.getElementById("buyNowBtn");
var closeBtn = document.getElementsByClassName("close")[0];
// Open the modal when Buy Now is clicked
buyNowBtn.onclick = function() {
modal.style.display = "block";
}
// Close the modal when the close button is clicked
closeBtn.onclick = function() {
modal.style.display = "none";
}
// Close the modal if user clicks outside of it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
// Form submission handling
var form = document.getElementById("customerForm");
form.onsubmit = function(event) {
event.preventDefault(); // Prevent form from submitting normally
// Show popup message
alert("Thank you for showing your interest, we will get back to you soon");
// Here you would handle form data (e.g., send it to a server)
// Close the modal
modal.style.display = "none";
};