I have configured comments to display in the node page, but if submit an invalid comment (e.g. without text in the comment field) I get redirected to the /comment/reply/ page. I would like to remain in the node page.

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

You can do this, by using hook_form_alter and then change the $form['#action'] value to point to the current destination.

link|improve this answer
Thanks, worked like a charm. – sharpbites Mar 22 '11 at 9:34
I would appreciate if you could write what code exactly and where I have to put this. – john May 26 '11 at 23:10
1  
I would appreciate if you write what code exactly and where I have to put it to achieve the wanted results. thanks – john May 26 '11 at 23:10
feedback

protected by Community Mar 30 at 0:20

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged or ask your own question.