Commit 3b680c7c authored by Zohten's avatar Zohten

now check if everything is ok

parent 6221fdfe
......@@ -10,7 +10,7 @@
<error-message id="error-password" errormessage="Les mots de passe ne correspondent pas." v-show="this.showPwdError"/>
<error-message id="error-mail" errormessage="Le mail rentré n'est pas valide" v-show="this.showMailError"/>
<error-message id="error-back" errormessage="Cet email ou ce pseudo est déjà pris." v-show="this.showBackError"/>
<error-message id="error-back" errormessage="Tous les champs obligatoires ne sont pas remplis." v-show="this.showNotFilledError"/>
</div>
<svg-button id="back" svg="/icons/back.svg"/>
......@@ -39,6 +39,7 @@ export default {
showPwdError : false,
showBackError : false,
showMailError : false,
showNotFilledError : false,
}
},
methods: {
......@@ -51,6 +52,17 @@ export default {
this.$router.push('/');
}
// Test if all fields are filled
this.showNotFilledError = (
document.getElementById('pseudo').value == ''
|| document.getElementById('mail').value == ''
|| document.getElementById('password1').value == ''
|| document.getElementById('password2').value == ''
);
if (this.showNotFilledError) {
return;
}
// Test if password match the confirm password
this.showPwdError = (document.getElementById('password1').value !== document.getElementById('password2').value);
if (this.showPwdError) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment