participer.thsf.net/static/scripts/participate.js

20 lines
627 B
JavaScript
Raw Normal View History

2018-02-26 19:53:06 +01:00
function register() {
var mail = document.getElementById('reg_mail').value;
var password = document.getElementById('reg_password').value;
var confirm = document.getElementById('reg_confirm').value;
var regEmail = new RegExp('^[0-9a-z._-]+@{1}[0-9a-z.-]{2,}[.]{1}[a-z]{2,5}$','i');
if (password.length < 8){
alert("Le mot de passe doit avoir une longueur d'au moins 8 caractères");
return false;
}
if (password != confirm){
alert("Confirmation mot de passe incohérente");
return false;
}
if (! regEmail.test(mail)){
alert("Adresse email invalide");
return false;
}
return true;
}