Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $("#errorMsg").html('<div class="style-msg errormsg clearfix"><div class="sb_msg clearfix">Invalid email or password</'+'div></'+'div>');
- $(".submitBtn1").click(function(){
- var username=$(".username").val();
- var password=$(".password").val();
- if(username!="" && password!="")
- {
- $.post("/site/AjaxLogin",{'username':username,'password':password,'LoginForm':'LoginForm'},function(r){
- var obj = JSON.parse(r);
- if(obj.message!="" && obj.message!="success"){
- //$("#errorMessage").html('<div class="sb_msg clearfix">'+obj.message+'</div>');
- }
- if(obj.message=="success"){
- window.location.href="http://www.spaste.com/site/dashboard";
- }
- else if(obj.message=="user"){
- window.location.href="http://www.spaste.com/site/dashboard";
- }
- else if(obj.message=="admin"){
- window.location.href="http://www.spaste.com/admin/dashboard";
- }
- else
- {
- $("#errorMsg").html('<div class="style-msg errormsg clearfix"><div class="sb_msg clearfix">'+obj.message+'</'+'div></'+'div>');
- }
- });
- }
- else
- {
- $("#errorMsg").html('<div class="style-msg errormsg clearfix"><div class="sb_msg clearfix">Fill all fields.</div></div>');
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement