The situation goes that in some situations you may want to have an iFrame embedded in a parent page and post the contents of a form to return a response in the iFrame.
The solution is simple. All one needs to do is set the iFrame as a target in form tags. The target should then point to the name of the iFrame. The action should be the same file as the iFrame source.
Here is a gist that shows you how the code should look like.