   
            if (saveButton) {
                saveButton.addEventListener('click', function(e) {
                    e.preventDefault();
                    
                    // Validate required fields
                    const productSelect = document.querySelector('select[name="productID"]');
                    if (!productSelect || !productSelect.value) {
                        alert('Please select a product!');
                        return;
                    }
                    
        