cancel and redirect page on editor.on('preSubmit'
cancel and redirect page on editor.on('preSubmit'
If user tries to submit a modification and session timeout has happened, I need to cancel submit but at the same time redirect him to the login page.
So to cancel submit I understand that the event has to return false:
editor.on( 'preSubmit', function ( e, data, action ) {
if ( abortSubmit ) {
return false;
}
} );
If the above is correct, where to add the:
header("Location: loginPage.php");
to redirect to the login page in this case?
Thanks
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This question has an accepted answers - jump to answer
Answers
I would simply use a timeout to make sure "false" gets returned from the event handler. I would also avoid using client side PHP ( header("Location: loginPage.php"); ).
Please use "Markdown" to make your code legible if you want a quick answer.