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
| $(document).ready(function () {
$("#registerform").click(function () {
$("#shadow2").fadeIn("normal");
$("#newuserform").fadeIn("normal");
// $("#username").focus();
});
$("#cancel_hide").click(function () {
$("#newuserform").fadeOut("normal");
$("#shadow2").fadeOut();
});
$("#newuserbutton").click(function () {
nom = $("#nom").val();
prenom = $("#prenom").val();
password = $("#password").val();
email = $("#email").val();
societe = $("#societe").val();
tel = $("#tel").val();
if (!$(email).val()) {
//alert('Vous n\'avez pas rentré d\'adresse mail !'); /* dans ce cas on lance un message d'alerte */
document.getElementById("err_nom").innerHTML = "Vous devez renseigner une adresse email valide";
} else {
$.ajax({
type: "POST",
url: "createuser.php",
data: "nom=" + nom + "&prenom=" + prenom + "&email=" + email + "&societe=" + societe + "&tel=" + tel + "&password=" + password,
success: function (html) {
$("#newuserform").fadeOut("normal");
//$("#shadow").fadeOut();
//document.getElementById("loginmodal").style.display="none";
//$("#profile").html("<a href='logout.php' id='logout'>Logout</a>");
$("#newuserform").fadeOut();
document.location.href = "index.php";
},
beforeSend: function () {
$("#add_info_user").html("Inscription en cours, veuillez patienter...");
//$("#login_form").hide();
// $('#modaltrigger').leanModal({ top: 110, overlay: 0.45, closeButton: ".hidemodal" });
}
});
//Fin du else verif existance email
} //Fin du else verif email
return false;
});
$('#newregister').leanModal({
top: 50,
overlay: 0.45
});
}); |
Partager