Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Validations were not visually updating when interacting #91

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/packs/entrypoints/application.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
import "src/signup_form.js"
import "src/confirmation_registration.js"

28 changes: 28 additions & 0 deletions app/packs/src/confirmation_registration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$(document).ready(() => {
$("#user_certification").on("change", function(e) {
const certificationField = event.target.parentNode.parentNode;
const certificationError = certificationField.querySelector('.form-error');

if (certificationError) {
certificationError.remove();
}
});

$(".select-date-container").on("change", function(e) {
const dateField = event.target.parentNode.parentNode;
const dateError = dateField.querySelectorAll('.form-error');
const invalidFields = dateField.querySelectorAll('.is-invalid-input');

if (dateError) {
dateError.forEach(error => {
error.remove();
});
}

if (invalidFields) {
invalidFields.forEach(field => {
field.classList.remove('is-invalid-input');
});
}
});
});
2 changes: 1 addition & 1 deletion config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fr:
address: Addresse
birth_date: Date de naissance
birth_date_help: Vous devez avoir plus de 16 ans pour avoir accès à ce service.
certification: Certification CESE
certification: Je certifie l'exactitude de ces informations.
city: Ville
code: Code postal
complete_profile: Complétez votre profil
Expand Down
Loading