Der Spirituosen-Blog von Conalco für Kenner und Genießer feiner Spirituosen!

Im Spirituosen Online-Shop von CONALCO versuchen wir jeden Tag einen guten Job zu machen. Informationen und Neuigkeiten rund um Spirituosen und um unsere Arbeit sind dafür wichtig. In unserem Blog teilen wir das alles mit Euch.

///////////////////////////////// // START POSTLEITZAHL HAUSNUMMER ///////////////////////////////// document.addEventListener('DOMContentLoaded', function() { function validateZipcode(zipcodeInput) { if (zipcodeInput) { zipcodeInput.setAttribute('required', 'required'); zipcodeInput.setAttribute('pattern', '^\\d{5}.*$'); zipcodeInput.setAttribute('title', 'Bitte geben Sie eine 5-stellige Postleitzahl ein'); var zipcodeLabel = document.querySelector('label[for="' + zipcodeInput.id + '"] span'); if (zipcodeLabel) { zipcodeLabel.classList.remove('d-none'); } } } function validateStreet(streetInput) { if (streetInput) { streetInput.setAttribute('required', 'required'); streetInput.setAttribute('pattern', '^[a-zA-Z]+.*\\d+.*$'); streetInput.setAttribute('title', 'Bitte geben Sie eine Straße + HAUSNUMMER ein.'); var streetLabel = document.querySelector('label[for="' + streetInput.id + '"] span'); if (streetLabel) { streetLabel.classList.remove('d-none'); } } } function setDefaultCountry(countrySelect) { if (countrySelect) { var deutschlandOption = Array.from(countrySelect.options).find(option => option.textContent.trim() === 'Deutschland'); if (deutschlandOption) { deutschlandOption.selected = true; } } } function initializeValidations() { document.querySelectorAll('[id*="AddressZipcode"]').forEach(function(zipcodeInput) { validateZipcode(zipcodeInput); }); document.querySelectorAll('[id*="AddressStreet"]').forEach(function(streetInput) { validateStreet(streetInput); }); document.querySelectorAll('[id*="AddressCountry"]').forEach(function(countrySelect) { setDefaultCountry(countrySelect); }); } initializeValidations(); // Event Listener für das shown.bs.modal Event hinzufügen document.addEventListener('shown.bs.modal', function(event) { initializeValidations(); }); // Event Listener für das shown.bs.collapse Event hinzufügen document.addEventListener('shown.bs.collapse', function(event) { initializeValidations(); }); // Event Listener für das hidden.bs.collapse Event hinzufügen document.addEventListener('hidden.bs.collapse', function(event) { initializeValidations(); }); }); ///////////////////////////////// // ENDE POSTLEITZAHL HAUSNUMMER /////////////////////////////////