Advertisement
Guest User

Untitled

a guest
Dec 1st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. $(document).ready(function(){
  2. $("#errorMsg").html('<div class="style-msg errormsg clearfix"><div class="sb_msg clearfix">Invalid email or password</'+'div></'+'div>');
  3. $(".submitBtn1").click(function(){
  4. var username=$(".username").val();
  5. var password=$(".password").val();
  6. if(username!="" && password!="")
  7. {
  8. $.post("/site/AjaxLogin",{'username':username,'password':password,'LoginForm':'LoginForm'},function(r){
  9. var obj = JSON.parse(r);
  10. if(obj.message!="" && obj.message!="success"){
  11. //$("#errorMessage").html('<div class="sb_msg clearfix">'+obj.message+'</div>');
  12. }
  13. if(obj.message=="success"){
  14. window.location.href="http://www.spaste.com/site/dashboard";
  15. }
  16. else if(obj.message=="user"){
  17. window.location.href="http://www.spaste.com/site/dashboard";
  18. }
  19. else if(obj.message=="admin"){
  20. window.location.href="http://www.spaste.com/admin/dashboard";
  21. }
  22. else
  23. {
  24. $("#errorMsg").html('<div class="style-msg errormsg clearfix"><div class="sb_msg clearfix">'+obj.message+'</'+'div></'+'div>');
  25. }
  26. });
  27. }
  28. else
  29. {
  30. $("#errorMsg").html('<div class="style-msg errormsg clearfix"><div class="sb_msg clearfix">Fill all fields.</div></div>');
  31. }
  32. });
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement