Back to my Opera Bugs page

Fixed in Version 9.

Opera ignores opening tags of nested forms (#143308)

External Pages Exhibiting Bug

Blue Mountains GARDENER - This page is up for testing by the developer and likely to disappear without notice. (Note as well as the nested forms issue, the #mid-column left-margin needs to be increased from 180px to 200px to display correctly in Opera - the author has been notified)

Providian Services - Attempt to log in with bogus details. The login button will not work because there is a nested form before it in the page code. This bug has closed the login form and the login button is no longer associated with any form.

Description

This page contains two forms, one nested inside the other. Nested forms are technically invalid, but unfortunately the W3C validator fails to detect them. This page passes the validation tests for XHTML 1.0 Strict, and is also likely to pass XHTML 1.1 tests. Even if the validator is enhanced to detect nested forms, the page will nevertheless be well formed in the XML sense.

Importantly, Microsoft's ASP.NET (or something) apparently encloses every page it generates inside a form with a hidden input field. Therefore, if a page needs a form of it's own, it will always be nested inside this all-enclosing ASP.NET form.

This entire page has been enclosed in a form, just like on ASP.NET pages. This enclosing form has been given a green colour.

There are also two <div>s - they are red. The inside form is styled blue. Interestingly, no browser (Opera 7.50, Firefox 0.8, IE 6.0) shows it as blue. (The browsers are ignoring styles on the inside form).

Consequences

The real problem is that since Opera has ignored the opening tag of the nested form, when it encounters the closing tag of the nested form, Opera thinks it's closing the outside form! Opera not only closes that outside form, but also closes any tags that are currently open, such as the div the inside form is in.

Whether the nested form should work or not, Opera should not be treating the opening nested form tag as if it doesn't exist!

Any page generated using ASP.NET which also needs to use forms of its own, will likely completely break when viewed by Opera, due to Opera closing tags beyond more than just the nested form. This has particularly serious implications for CSS styling.

Demonstration

First division. This text is before the inside form.

This text is inside the inside form. The button below should submit this form to a non-existent script and generate an error, but does not. Instead this inside form is submitted to the outside form.

This text is still inside the inside form.

This is after the inside form, but still inside the div the inside form is in, and should therefore be within the red border, which itself should still be inside the green form. The button below should submit the outside form (and display a diagnostics page), but does not:

Second division. This should also still be inside the green form.

Below the second division, still inside the green form.

Back to my Opera Bugs page