Repository navigation
Expand file tree
/
Copy pathscript.js
More file actions
39 lines (35 loc) · 1.45 KB
/
Copy pathscript.js
File metadata and controls
39 lines (35 loc) · 1.45 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
34
35
36
37
38
39
document.addEventListener('DOMContentLoaded', function() {
// Smooth scrolling for nav links
document.querySelectorAll('nav a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Handle form submissions
const quoteForm = document.querySelector('#quote form');
const uploadForm = document.querySelector('#uploadLogs form');
quoteForm.addEventListener('submit', function(e) {
e.preventDefault();
alert('Quote request submitted. We will get back to you shortly!');
quoteForm.reset();
});
uploadForm.addEventListener('submit', function(e) {
e.preventDefault();
alert('Flight log uploaded successfully. Your discount will be applied!');
uploadForm.reset();
});
// Set drone company for upload on button click
document.querySelectorAll('.upload-button').forEach(button => {
button.addEventListener('click', function() {
const company = this.getAttribute('data-company');
const companySelect = document.querySelector('#uploadLogs select[name="company"]');
companySelect.value = company;
document.querySelector('#uploadLogs').scrollIntoView({
behavior: 'smooth'
});
});
});
});