How to Post HTML Form Data to New Window?

In one of our projects, we had to pass the html form data to new window.
i-e On clicking the submit button in the form, the action page should open in the new pop-up window.
Below code can be used for achieving this requirement.
Click this link to view the code