document.addEventListener('DOMContentLoaded', function () {
    const fname = document.getElementById('fname');
    const lname = document.getElementById('lname');
    const contact1 = document.getElementById('contact1');
    const counselor = document.getElementById('counselor');

    function checkInputs() {
        if (fname.value && lname.value && contact1.value) {
            counselor.classList.remove('disabled');
            counselor.disabled = false;
        } else {
            counselor.classList.add('disabled');
            counselor.disabled = true;
        }
    }

    fname.addEventListener('input', checkInputs);
    lname.addEventListener('input', checkInputs);
    contact1.addEventListener('input', checkInputs);

    // Initialize the state of the select element
    checkInputs();
});