What is submitUnsuccessful event proposed to return?
What is submitUnsuccessful event proposed to return?
Using the submitUnsuccesful event in Editor: editor.on('submitUnsuccessful', function(e, xhr, err, thrown, data), I expected to receive some values in i.e. err. But err, thrown and data are undefined.
I tried to use this because I want to know if there were fields invalidated by the server. The event is called when fields are invalid, but there is nothing inside err, thrown and data. I have to assume that on server-side I am not using DataTables and yes my own PHP routines.
I resolved my need by using the event postSubmit, but I thought that I could use an event more relevant for my needs.
This question has an accepted answers - jump to answer
Answers
The
submitUnsuccessfuldocumentation shows that the information passed into the event handler iseandjson.The JSON data returned from the server contains information about what fields are in error. The JSON structure for this is documented here - specifically
fieldErrorsis probably want you'd want to look at.Allan