I have a login / password field, when some user does not fill in one of the inputs, I display a message using ajax like this:
$('#loginform').submit(function(event)
{
// Values
var login = $.trim($('#username').val()),
pass = $.trim($('#password').val());
// Check inputs
if (login.length === 0)
{
// Display message
displayError('Por Favor, insira seu nome de usuario!');
return false;
}
else if (pass.length === 0)
{
// Remove empty login message if displayed
formWrapper.clearMessages('Por Favor, insira sua porta!');
// Display message
displayError('Por Favor, insira sua senha!');
return false;
}
But when the user misses the password or user, it returns to the login url in the following form:
How would I do, to capture this erro=senha_incorreta
and display the same warning style that is displayed when the form is blank?
Something like:
if (?erro === senha_incorreta)
{
// Display message
displayError('Sua senha está incorreta!');
return false;
}
Can someone help me with an example of how I would display the message when such a url was requested?