Pop-up is breaking page when placing Contact Form 7 form in it.

When I place a simple Name/Email form built in Contact Form 7 into the pop-up code area, when the form is submitted it severely breaks the page and shows weird HTML.

Example page with popup:

Form works fine without popup: