Advertisement
Guest User

Untitled

a guest
Nov 26th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. $(document).ready(function(){
  2. $('#register_me').on('submit',function(e){
  3. e.preventDefault();
  4. swal({title:"Recherche en cours...",
  5. text:"Cela prend généralement moins de 3 secondes.",
  6. type:"info",
  7. showConfirmButton:false});
  8. var $this=$(this);
  9. var pseudonyme=$('#bean_username').val();
  10. var mail=$('#bean_email').val();
  11. var pswd=$('#bean_password').val();
  12. var pswd2=$('#bean_repassword').val();
  13. var genre=$('#gender').val();
  14. var captcha=$('#bean_captcha').val();
  15. if(pseudonyme===''||pswd===''||pswd2===''||mail===''||genre===''||captcha===''){
  16. swal("Erreur!","Les champs doivent être remplis.","error");
  17. }else{
  18. $.ajax({
  19. url: "./web/ajax/inscription.php",
  20. type: "post",
  21. data: {bean_username: pseudonyme, bean_password: pswd, bean_repassword: pswd2, gender: genre, bean_email: mail, bean_captcha: captcha},
  22. success:function(html){
  23. if(html=="9c3c68f4c4fbf27f641d427af7cc265caed2ede5"){
  24. swal({title:"Compte crée!",
  25. text:"Tu peux maintenant te connecter à ton compte.",
  26. type:"success",
  27. timer:800,
  28. showConfirmButton:false});
  29. window.setTimeout(function(){
  30. },
  31. 1000);
  32. }else{
  33. swal("Erreur!",html,"error");
  34. }
  35. }
  36. });
  37. }
  38. });
  39. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement