Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
in Q2A Core by
If you post an answer below the minimum characters, e.g. just "test", when you submit it the page jumps to the top and scrolls back down to the answer. The error appears fine, but it should be that that appears and the page shouldn't move.
Q2A version: 1.5

1 Answer

0 votes
This is the intended behavior. Javascript submission of answers and comments falls back to non-Javascript submission if there is any sort of error.
Hmm, somehow I missed that it was actually doing a page request. I think the Javascript can be improved so that if the AJAX returns an error, you can display the error text instead of submitting the form.
Yes, it would be ideal. But I don't do this because there are some cases (e.g. with a CAPTCHA) where the form would need to be fully reloaded if there was an error. Since it's hopefully a relatively rare case for a submission to cause an error, I decided to compromise on this solution.
OK the CAPTCHA thing makes sense. I'd suggest at least adding the length check, as this is pretty common in my experience (often an answer to a question could be just "yes" or "no").

You can even do that without AJAX, just dynamically add JS variables to the JS in the head, and check before doing the AJAX submission.