fix: Remove opposite highlight classes to just display the most recent one.
This commit is contained in:
parent
bf2f5b3bde
commit
28c60c7912
@ -49,6 +49,7 @@ contact_form.addEventListener('submit', function(event) {
|
||||
.then(json => {
|
||||
console.log(json);
|
||||
if (json.errors) {
|
||||
feedback.classList.remove('--success');
|
||||
feedback.classList.add('--error');
|
||||
// Über errors iterieren und diese ausgeben (evtl. nur ersten Fehler ausgeben?)
|
||||
let error_message = '';
|
||||
@ -69,6 +70,7 @@ contact_form.addEventListener('submit', function(event) {
|
||||
})
|
||||
feedback.innerHTML = error_message;
|
||||
} else if (json.status == 'ok') {
|
||||
feedback.classList.remove('--error');
|
||||
feedback.classList.add('--success');
|
||||
feedback.textContent = "Deine Nachricht wurde erfolgreich ans Office geschickt.";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user