Kelly L. Andersen, Attorney At Law Oregon Personal Injury, Accident & Abuse Attorney | Medford, Grants Pass Home - Oregon Personal Injury, Accident & Abuse Attorney | Medford, Grants Pass
409 Pine StreetSuite 303 Klamath Falls, OR97601-6020
Kelly L. Andersen, Attorney At Law Oregon Personal Injury, Accident & Abuse Attorney | Medford, Grants Pass Home - Oregon Personal Injury, Accident & Abuse Attorney | Medford, Grants Pass
777 NE Seventh StreetSuite 206 Grants Pass, OR97526-1632
Law Offices of Kelly L. Andersen Oregon Personal Injury, Accident & Abuse Attorney | Medford, Grants Pass Home - Oregon Personal Injury, Accident & Abuse Attorney | Medford, Grants Pass
Enhance your legal case details with LawyerLand AI's
intelligent guidance, connect with numerous qualified law firms in your area, and find the ideal
legal representation through our competitive chat platform.
;
document.addEventListener('DOMContentLoaded', function () {
// Reference to the form elements
const categorySelect = document.getElementById('category');
const subcategorySelect = document.getElementById('subcategory');
if (categorySelect && subcategorySelect) {
// Function to update subcategories based on selected category
function updateSubcategories() {
// Store current selection if any
const currentSelection = subcategorySelect.value;
// Clear existing options
subcategorySelect.innerHTML = '';
// Get selected category
const selectedCategory = categorySelect.value;
// If no category selected, hide subcategory dropdown
if (!selectedCategory) {
subcategorySelect.disabled = true;
return;
}
// Enable the dropdown
subcategorySelect.disabled = false;
// If we have subcategories for this category, add them
if (subcategories[selectedCategory]) {
subcategories[selectedCategory].forEach(function (subcat) {
const option = document.createElement('option');
option.value = subcat;
option.textContent = subcat;
// Set selected if matches current selection or matches the subcategory variable
if (subcat === currentSelection ||
subcat === '') {
option.selected = true;
}
subcategorySelect.appendChild(option);
});
}
}
// Attach event listener to category dropdown
categorySelect.addEventListener('change', updateSubcategories);
// Initialize subcategories on page load
updateSubcategories();
// If category is pre-set, make sure subcategories get populated
setTimeout(function () {
updateSubcategories();
}, 100);
}
});