I am not sure how to explain this one as it has baffled me and I don’t have a great deal of code to show what I mean, BUT I will try:
I have an ASP.NET website using Master pages. The source would show something like:
<body>
<form id="main" runat="server">
<div id="main">
<div id="left"></div>
<div id="main_content">
<div id="content"></div>
</div>
<div id="right"></div>
</div>
</form>
</body>
I allow the user to set the content of the “content” div using a WYSIWYG editor that accepts HTML. The problem I am seeing in IE8 (not sure about others)(Mozilla fine) is when I have a form in the content the source changes to this:
<body>
<form id="main" runat="server">
<div id="main">
<div id="left"></div>
<div id="main_content">
<div id="content"></div>
</div>
</div>
</form>
<div id="right"></div> // BEEN MOVED?!?!
</body>
which is then throwing the div below the main content instead of sitting beside it. I find this really odd and I know it has something to do with the form as I have tested without and the div shows in the right place.
EDIT: Is it something to do with wrapping form tags inside each other?
Anyone got any ideas?
Thanks.
Oh, dear long day I think 🙂
You can’t nest a form within a form so make sure the content from the editor doesn’t contain a form.
Sigh ..