Thanks..
following is the ajax coding to get the result
Code:
submitHandler : function(form) {
if($('#login').submit(function(){return false;}))
{
$.ajax
({
type: 'POST',
url: $('#login').attr('action'),
data: $('#login').serialize(),
success: function(data)
{
$('#results').html(data);
}
});
}
return false;
},
following is the php code, while this validation messages passes through this php code, it produce the correct error message "please enter your name"from the following
{"output":"","status":-1,"error_messages":{"error":["please enter your name."],"success":[]}}
But when we submitting it through ajax it is not going to the below coding , that is the problem iam getting some more results with the error message
Code:
if (isset($vars['object']) && is_array($vars['object']) && sizeof($vars['object']) > 0) {
foreach ($vars['object'] as $type => $list ) {
foreach ($list as $message) {
echo '<div id="error-msg">'.$message.'</div>';
}
}
}
Code:
<?php echo $messages; ?>
//displays the error message
Bookmarks