Answer the question
In order to leave comments, you need to log in
How to stay on the same page after clicking on the publish button?
After clicking on the button, the page redirects to another one, is there any way to prevent this?
Answer the question
In order to leave comments, you need to log in
You can listen to the form's submit event and call event.preventDefault() internally. This will cancel sending the request (accordingly, there will be no redirect either), so you will have to send the ajax request yourself.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question