I used validation for my login field with jQuery & Javascript, and it works. When there is no username or password the span text changes.
When the details are correct and I press login it just reloads the page again, instead of starting the session etc.
But if I enter a valid username with a wrong password, PHP kicks in and displays incorrect password
or if I enter an invalid username, it says username not found
.
This is such a weird problem. I have a feeling it's due to the fact I am returning a flag to check sending, after the Javascript validation:
$(document).ready(function() {
$('#loginf').submit(function(){
var flag = true
//stuff to validate each field
//ie: for each field i have:
if(//empty field) {
//stuff flag= false;
}
return flag;
});
});