2
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 user misses password or user, it goes back to login url in the following form:
As I would, 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 anyone help me with an example of how I would display the message when such a url is requested?
In this link I believe I have everything you need: http://www.blogalizado.com.br/ajax-e-json-com-jquery-e-php/
– Papa Charlie
All right, I’ll see!
– Cassiano José