aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes form not allowed in table tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "form not allowed in table tag?" Watch "form not allowed in table tag?" New topic
Author

form not allowed in table tag?

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Hey folks, got a quick question for anyone who knows the standards:
Is a form tag not really allowed to be inside of a table tag?
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Do you literally mean inside a table tag? Or do you mean inside a td tag? Inside table cells, yes.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
I understand what you mean by the difference, but I really meant in general--either one. A form tag isn't supposed to be anywhere within a table or tr or td tag, right?
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
I'm not sure, for sure. I've never had problems using forms within table cells. I've had some problems nesting a table in a form, where the table had some form input fields. I suppose you could check out the XHTML DTD and see for sure what elements allow a form inside it. Have you gone that route?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I am not sure if there is some new XHTML thing that bans this, but I doubt it....

Eric
[ April 23, 2004: Message edited by: Eric Pascarello ]
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
If you look at the XHTML DTD (which though you may not be using, will closely mirror the expectations of the rendering browser), table only allows certain elements (none of which is a form or form-derived element:

Well you get the idea. Solution #2 of course is simpley not well-formed, so that will croak every time. #3 and #4 as you say are just fine, so I would try and cram whatever design you need into something similar to those.
The XHTML DTD can be found at: here.
[ April 23, 2004: Message edited by: Nathaniel Stoddard ]
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
Ok, good to know. One issue I've noticed (in at least IE 6) is that when there are two forms on a page, my browser got confused about which one was being submitted when I would just hit Enter. I will try to move the site away from table-based design in general to hopefully avoid other little quirks and just plain maintenance annoyance...
 
Consider Paul's rocket mass heater.
 
subject: form not allowed in table tag?