Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function login() {
- var user = $('#uName').prop('value');
- var password = $('#uPassword').prop('value');
- user = user.trim();
- password = password.trim();
- if(user == ""){
- $("#message").html("Enter a User Name");
- $('#uName').focus();
- return false;
- }
- if(password == ""){
- $("#message").html("Enter the Password");
- $('#uPassword').focus();
- return false;
- }
- $.ajax({
- url: "login",
- type: "POST",
- dataType: "json",
- data: {username: user,password:password},
- async: false,
- cache: false,
- success: function(response){ if(response["status"] == "success") {
- $("#message").html(response["message"]);
- showMsg();
- $("#hidStatus").prop("value","update");
- } else if(response["status"] == "failure") {
- $("#message").html(response["message"]);
- showMsg();
- }
- },
- error: function(err){
- alert("Error in Login...");
- }
- });
- }
Add Comment
Please, Sign In to add comment