Internet Explorer Nested Form Post
asp.net, asp.net-mvc
Solution
Nested forms are not vaild, and therefore their behavior is undefined. You just cannot nest them. Only one form can submit at a time, though you can have multiple, unnested forms on a page (only the one of the corresponding submit button will be submitted, though).
Problem
I'm am using ASP.NET MVC to create a page that posts to the Paypal sandbox. My form that posts to the Paypal site is nested inside a parent form. I am using Internet Explorer 7, and for some reason, the nested form posts to my local machine instead of the paypal site. If I add a copy of the same nested form directly after the first, the first one posts to localhost, and the second posts to where it is expected. ``` <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title> </title> </head> <body> <form name="aspnetForm" method="post" action="" id="aspnetForm"> <!--First form posts locally--> <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="submit" value="Pay"/> </form> <!--Second identical form posts to the expected destination--> <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="submit" value="Pay"/> </form> </form> ```