n the selected type
            document.getElementById('wedding-fields').style.display = type === 'wedding' ? 'block' : 'none';

            // Update the display of 'birth-fields' based on the selected type
            document.getElementById('birth-fields').style.display = type === 'birth' ? 'block' : 'none';

            // Update the display of 'death-fields' based on the selected type
            document.getElementById('death-fields').style.display = type === 'death' ? 'block' : 'none';

            