this is not working and i cant really see anything wrong with it, looks straightforward enough:
$("#formLogin").submit(function(){
var username = $("#username").val();
var password = $("#password").val();
if (username == ' ' || password == ' '){
return false;
}
else return true;
});
EDIT:
Its still submitting the form even if the fields are empty
Are you trying to detect blank usernames and passwords?
jquery.trim() removes leading and trailing spaces, so just in case the user types a number of space characters it will be detected.