Open bellwood opened 7 years ago
Making a post to help out any one who is wanting to present their users with errors from the server-side.
My application is based off this tutorial/example:
http://phpflow.com/demo/bootgrid-php-mysql-serverside-demo/
In my backend, if I'm not returning success/true/1, I am returning a string containing the error.
I am then handling that via the ajax error handler with ajax call made at the bottom of the script:
$.ajax({ type: "POST", url: "ajax.php", data: data, dataType: "json", success: function(response){ $('#'+action+'_model').modal('hide'); $("#grid").bootgrid('reload'); }, error: function(jqXHR, textStatus, errorThrown) { $('#'+action+'_model').modal('hide'); $('#errorMessages').html(jqXHR.responseText); $('.alert').removeClass('hidden'); } });
HTH
Making a post to help out any one who is wanting to present their users with errors from the server-side.
My application is based off this tutorial/example:
http://phpflow.com/demo/bootgrid-php-mysql-serverside-demo/
In my backend, if I'm not returning success/true/1, I am returning a string containing the error.
I am then handling that via the ajax error handler with ajax call made at the bottom of the script:
HTH