How to use $form['#action'] in Views PHP field I print the comment form for each node in my view with the Views PHP module. The URL of the view is user/%/selection, and the code I am using is the following one.

$comment = new stdClass;
$comment-&gt;nid = $row-&gt;nid;
$form = drupal_get_form('comment_node_MYCONTENTTYPE_form', $comment);
$form['#action'] = url('user/'.$row-&gt;uid.'/selection');
print render($form);


When the form is submitted, I get /node/nid#comment-17 as URL.

Could you explain why $form['#action'] doesn't work?
Instead of this method, why cannot a new submit handler be written? so that you can use drupal_goto there and redirect.