I am adding content to my page using file_get_contents
(I'm rendering the content to strip all template html as in this example: https://stackoverflow.com/questions/247991/displaying-a-drupal-view-without-a-page-template-around-it).
Some of the pages have forms which should be submitted normally, as in the page should be validated and redirected after submission. However submission is not working. For example, if the page is at http://mysite.com/myform and pressing the cancel button should call myform_cancel() and redirect me to http://mysite.com/, I instead get redirected to http://mysite.com/myform?response_type=embed and no submit methods are called.
What do I need to so to make my form submit as expected?
Edit:
A similar thing happens when I instead render the form using menu_get_item
to get the callback and arguments, then render the html using: drupal_render(call_user_func_array($menu_item['page_callback'], $menu_item['page_arguments']))
. This time I am redirected to my 'http://mysite.com/ajax-form' which is my menu url to the ajax call used to return the html.