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

40 lines
1.2 KiB
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;
}
2018-02-27 19:51:43 +01:00
function update_account() {
var password = document.getElementById('password').value;
var confirm = document.getElementById('confirm').value;
if (password != confirm){
alert("Confirmation mot de passe incohérente");
return false;
}
if (password.length > 0 && password.length < 8){
alert("Le mot de passe doit avoir une longueur d'au moins 8 caractères");
return false;
}
return true;
}
function delete_account(id) {
if (confirm("La suppression d'un compte est définitive.\n\nConfirmer ?")) {
document.location='/account/delete/'+id;
}
}