
Originally Posted by
traq
with your ajax call, you're trying to treat the return value as html. If you specify that you're expecting json, you can use it like json:
Code:
$.ajax({
type: 'POST',
url: $('#login').attr('action'),
data: $('#login').serialize(),
dataType: 'json',
success: function( data ){
var errMsg = data.error_messages.error[0];
$('#results').html( '<p>The error message is: <b>'+errMsg+'</b>' );
}
});

Originally Posted by
traq

Originally Posted by
letom
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
I'm not sure what you mean by this.
That is FYI only, to understand the php coding / i mean putting some more equal code like that in javascript will produce correct result.
Eg .. foreach provides a way to iterate over arrays in php / $.each is some more similar in java script
I will let you know here the result.... But i tried previously some more related to that, but not producing the accurate one
Last edited by traq; 05-19-2013 at 07:56 PM.
Reason: fixed quote tags
You will know the truth, and the truth will set you free (John 8:32)(The truth is about the only begotten son of GOD.....When you feel you are alone for facing your problems, God will never leave you by your own You are important for God
Bookmarks