Guest User

Untitled

a guest
Jan 14th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. //check password and username validation
  2. //at somepoint we need to add so that you can't register the same email address multiple times
  3.  
  4. //just validate the password and post it
  5.  
  6. $(document).ready(function(){
  7. $("#facebookSubmit").click(function(){
  8. $("#cSubmitError").html("");
  9.  
  10.  
  11.  
  12. var password = $("#fpass").val();
  13. var userName = $("#fuserName").val();
  14. var userEmail = $("#fuserEmail").val();
  15. var userImage = $("#fuserImage").val();
  16. var userGender = $("#fuserGender").val();
  17. var userAge = $("#fuserAge").val();
  18. var userLocation =$("#fuserLocation").val();
  19. var validation = true;
  20.  
  21.  
  22. if (password=="") {
  23. validation = false;
  24. $("#cSubmitError").html($("#cSubmitError").html()+"Please enter a password.<br>");
  25. }
  26.  
  27. if (password.length<6 && password!="") {
  28. validation = false;
  29. $("#cSubmitError").html($("#cSubmitError").html()+"Please enter a longer password\n\
  30. at least 6 characters long.<br>");
  31. }
  32.  
  33.  
  34.  
  35. if (validation==true) {
  36.  
  37. $.ajax({
  38. type: "POST",
  39. data: "password="+password+"&userName="+userName+"&userEmail="+userEmail+"&userImage="+userImage+"&userGender="+userGender+"&userAge="+userAge+"&userLocation="+userLocation,
  40. url: "Facebookuser_login2.php",
  41. success: function(msg)
  42. {
  43. msg = $.trim(msg)
  44. var url = "padd_registration.php?userID="+msg
  45. window.location = url
  46. }
  47. });
  48.  
  49. }
  50. });
  51. });
Add Comment
Please, Sign In to add comment