Skip to content

Commit c75e8fb

Browse files
committed
signup works too. all are functional. Testing needed.
1 parent eff81a7 commit c75e8fb

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

Diff for: Frontend/src/js/modals/signup.js

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import * as bootstrap from 'bootstrap'
2-
31
document.addEventListener('DOMContentLoaded', function() {
42
// Initialize the Bootstrap modal
53
var signUpModalElement = document.getElementById('signUpModal');
64
if (!signUpModalElement) {
75
console.error('Sign Up modal element not found');
86
return;
97
}
10-
var signUpModal = new bootstrap.Modal(signUpModalElement);
118

129
var modalTitle = document.getElementById('signUpLabel');
1310
var modalBody = document.querySelector('#signUpModal .modal-body');
@@ -53,7 +50,7 @@ document.addEventListener('DOMContentLoaded', function() {
5350
})
5451
.then(data => {
5552
console.log('Success:', data);
56-
signUpModal.hide();
53+
document.getElementById('signupModal').querySelector('.close').click(); // Close the modal
5754
document.getElementById('signUpForm').reset();
5855
})
5956
.catch(error => {
@@ -104,14 +101,4 @@ document.addEventListener('DOMContentLoaded', function() {
104101
document.getElementById('signUpPassword').value = '';
105102
document.getElementById('signUpRePassword').value = '';
106103
}
107-
108-
// Reset form fields and hide error message when modal is hidden (on modal close)
109-
signUpModal._element.addEventListener('hidden.bs.modal', function () {
110-
document.getElementById('signUpForm').reset();
111-
// Remove any error messages
112-
const errorSpans = document.querySelectorAll('#signUpModal .ErrorMessage');
113-
errorSpans.forEach(function(errorSpan) {
114-
errorSpan.remove();
115-
});
116-
});
117104
});

0 commit comments

Comments
 (0)