1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
$(document).ready(function(){
identifiantRegister_error = true;
$("#identifiantRegister").keyup(function () {
identifiantRegister_check();
});
function identifiantRegister_check() {
identifiantRegister = $("#identifiantRegister").val();
if(identifiantRegister == "") {
$("#error_identifiant").addClass("active-error").html("Identifiant obligatoire");
identifiantRegister_error = false;
return false;
} else {
$("#error_identifiant").removeClass("active-error").html("");
}
if(identifiantRegister.length < 3) {
$("#error_identifiant").addClass("active-error").html("Identifiant invalide (4 caractères minimums)");
identifiantRegister_error = false;
return false;
} else {
$("#error_identifiant").removeClass("active-error").html("");
}
if(identifiantRegister != "" && identifiantRegister.length >= 3) {
$.post(
"users/register/check_identifiant_exist.php",
{
identifiantRegister : $("#identifiantRegister").val()
},
function(data) {
if(data == "Success") {
} else {
$("#error_identifiant").addClass("active-error").html("Identifiant déjà pris");
identifiantRegister_error = false;
return false;
}
},
"text"
);
}
}
$("#btn_identifiant").click(function() {
identifiantRegister_error = true;
identifiantRegister_check();
if(identifiantRegister_error == true) {
$("#register_form #tab1").removeClass("active");
$(".tabs-list .tab1").removeClass("active");
$("#register_form #tab2").addClass("active");
$(".tabs-list .tab2").addClass("active");
$(".item2").addClass("form-steps__item--completed");
return true;
} else {
return false;
}
});
$("#previous_btn_email").click(function() {
$("#register_form #tab2").removeClass("active");
$(".tabs-list .tab2").removeClass("active");
$("#register_form #tab1").addClass("active");
$(".tabs-list .tab1").addClass("active");
$("#error_identifiant").text("");
$(".item2").removeClass("form-steps__item--completed");
});
}); |
Partager