Monday 11 May 2009

Firefox and form tags

Here's one for you.

If you have a table layout with form elements within it, make sure you place the form tags outside the table altogether. Put them just inside the body tag if you can.

I was putting form tags within table tags, and it was causing the form to close itself prematurely.

I was using javascript to render the form elements, and when looking at the generated source, I saw that firefox was closing the form tag early.

It works okay within IE 8, though it breaks in Chrome and Firefox.

Let that be a lesson to you. It certainly was for me!