Emergency Response: Please provide detailed information about your storm damage.
This will help us prioritize your case and dispatch the appropriate technicians.
// Form validation
(function() {
'use strict';
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.querySelectorAll('.needs-validation');
// Loop over them and prevent submission
Array.prototype.slice.call(forms)
.forEach(function(form) {
form.addEventListener('submit', function(event) {
if (!form.checkValidity()) {
event.preventDefault();
event.stopPropagation();
}
form.classList.add('was-validated');
}, false);
});
// File size validation
document.getElementById('photo').addEventListener('change', function(e) {
const file = e.target.files[0];
if (file) {
const maxSize = 5 * 1024 * 1024; // 5MB
if (file.size > maxSize) {
showCustomAlert('File size must be less than 5MB.');
e.target.value = '';
}
}
});
})();