diff --git a/app/packs/entrypoints/application.js b/app/packs/entrypoints/application.js index 7517a59..f11f871 100644 --- a/app/packs/entrypoints/application.js +++ b/app/packs/entrypoints/application.js @@ -1,2 +1,3 @@ import "src/signup_form.js" +import "src/confirmation_registration.js" diff --git a/app/packs/src/confirmation_registration.js b/app/packs/src/confirmation_registration.js new file mode 100644 index 0000000..88fc7e3 --- /dev/null +++ b/app/packs/src/confirmation_registration.js @@ -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'); + }); + } + }); +}); \ No newline at end of file diff --git a/config/locales/fr.yml b/config/locales/fr.yml index dce1e80..9a086a7 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -64,7 +64,7 @@ fr: address: Adresse 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