Guest User

Untitled

a guest
Jul 9th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. $(function(){
  2. $("input#register_btn").click(function(){
  3.  
  4. $('.error').hide();
  5. var user = $('input#user').val();
  6. if(user == ""){
  7. $('.error').show();
  8. $('.error').html("Username cannot be blank. Please use the username you login with.");
  9. $("input#user").focus();
  10. return false;
  11. }
  12. var pass = $('input#pass').val();
  13. if(pass == ""){
  14. $('.error').show()
  15. $('.error').html('Password cannot be blank. Please enter something.')
  16. $("input#pass").focus();
  17. return false;
  18. }
  19.  
  20. var pass2 = $('input#pass_confirm').val();
  21. if(pass2 == ""){
  22. $('.error').show()
  23. $('.error').html('Password cannot be blank. Please enter something.')
  24. $("input#pass2").focus();
  25. return false;
  26. }
  27.  
  28. if(pass2 != pass){
  29. $('.error').show()
  30. $('.error').html('The passwords you entered do not match. Please reenter them.')
  31. $("input#pass").focus();
  32. return false;
  33. }
  34.  
  35. var email = $('input#email').val();
  36. if(email == ""){
  37. $('.error').show()
  38. $('.error').html('Email address cannot be blank.')
  39. $("input#email").focus();
  40. return false;
  41. }
  42.  
  43. form.submit();
  44.  
  45. });
  46. });
Add Comment
Please, Sign In to add comment