This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

You can change the default behavior of an AJAX error from displaying an alert() message, like this:

<script>
$(window).on('ajaxErrorMessage', function(event, message){

    // This can be any custom JavaScript you want
    alert('Something bad happened, mate, here it is: ' + message);

    // This will stop the default alert() message
    event.preventDefault();

})
</script>

Enjoy! :-)

Cheers for this, daftspunk.

For data-request-confirm, you can use ajaxConfirmMessage.

How can I translate error messages to another language?

maxim.shvets9654 said:

How can I translate error messages to another language?

Yes, how we can?

@daftspunk, thanks it was helpful

Brilliant @daftspunk.

Any preferred JS flash lib to use for the errors instead?

Cheers!

I like SweetAlert (my implementation here) but really depends on your needs. If you need a toast message try Toastr I didn't have the chance to use it but it looks promising. And there is always the simplest option of showing/hiding a div

1-8 of 8

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.