1. Douglas H. Smith Rhode Island Business Law Attorney | Providence Construction Lawyer RI For legal help with Rhode Island real estate and construction law, contact attorney Douglas H. Smith at 401-467-3590 in Providence, RI. Providing quality legal service at a reasonable rate for 28 years.
2. Comerford & Saccoccio Rhode Island Criminal Law Attorney | Johnston Divorce | Unemployment Law For experienced criminal defense, family and unemployment law attorneys in Johnston, RI, contact Comerford & Saccoccio at 401-354-7256.
3. William M. Ryan, Esq. William M. Ryan, Esq. Blackstone, Massachusetts, Real Estate Estate Planning Probate Family Personal William M. Ryan, Attorney in Blackstone, Massachusetts involving real estate, estate planning, probate, family, personal injury, litigation, business and bankruptcy law matters.
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 === 'Government Agencies') {
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);
}
});