Redirect after post a question

5.88K viewsIssues
0

Hi everyone. I’m getting this console errors when I hit the submit question button to post a new question. It do post the new question but doesn’t redirect to the index page. And the user can’t realize it. Anyone have an idea? Screenshot:

0

Hi Guys. I was working with a bit complex site an I wasn’t allowed to disable another plugins. So I solved using this javascript code:

window.onload=function() {
document.getElementById(“ask_form”).onsubmit =function() {
window.location.replace(“yoururl.com”);
return false;

}

}

So now I’m redirecting to the anspress index after submit a new question. It works well by now. What do u thing about this solution?

commented on answer

This is not AnsPress issue. Some other plugin is breaking response by outputting dump. It will be better to find the cause of issue rather this using above javascript code. As it will not check if there is any error on form submission. Most easiest way would be download wp-contest folder and search for `var_dump` and `print_r` using a text search software.

0

Hello,

This is happening because some plugins using var_dump or print_r. Please try disable all plugin one by one.

Same problem was posted few days ago and it was solved by disabling a plugin which was causing this.

1

I have the same problem! There is one older topic about this issue but the potential fix is a bit complicated for me to understand. https://anspress.io/questions/question/redirect-after-submitting-a-question-or-answer-2/

commented on answer

Thanks for answering. Yeah, I have the same issue, I really don’t get how he solved it. I hope somebody help us soon.