Question : Nested forms asp.net IE8

My Masterpage contains the server form which wraps the content pages.

I need to include a content page with a post form for Paypoint but this breaks in IE8

Please can someone help?

Answer : Nested forms asp.net IE8

Unfortunately, according to W3C, you cannot have nested form tags in HTML.  It is bad format and will either result in error when submitting the form, or your form will submit to the top level form object.

The way I was able to get around this was by creating a BUTTON as a button, rather than a submit button.  This way, you can add an ONCLICK event to this new button and execute some javascript code.

I've included some code below:
1:
2:
3:
4:
5:
6:
7:
8:
9:
<asp:Button UseSubmitBehavior="false" OnClientClick="DoPaypoint();" ID="PaypointSubmit" runat="server" Text="Submit" />

<script language="javascript">
function DoPaypoint()
{
     document.forms[0].action = "...paypointurl...";
     document.forms[0].submit();
}
</script>
Random Solutions  
 
programming4us programming4us