Welcome to WebmasterWorld Guest from 54.145.166.247

Forum Moderators: incrediBILL

Message Too Old, No Replies

fieldset not valid HTML?

   
12:23 am on Mar 8, 2012 (gmt 0)

5+ Year Member



I applied to Infolinks in order to experiment with them on my sites. My application was denied because of 'incompatible tags'. After having written to support, I received the following reply:
The <fieldset> tag is used to group related elements in a form (draws a box around the related elements). The Infolinks algorithm systematically ignores the contents of the <fieldset> tag to avoid placing highlighted links in forms.


Well, I have dozens of fieldsets in my sites, and none of them are in forms. Are fieldsets supposed to be ONLY in forms?
5:32 am on Mar 8, 2012 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Here's what the W3C has to say:

The <fieldset> element represents a set of form controls optionally grouped under a common name.

[w3.org...]
How do your pages use <fieldset> if it's not for form controls?
6:19 am on Mar 8, 2012 (gmt 0)

5+ Year Member



I have always been using fieldset outside of forms to make a simple box

like this


for which, amazingly, webmasterworld uses table / tr / td - a lot of code for the same result!

It's so much shorter with fieldset, and it validates 100%.
6:28 am on Mar 8, 2012 (gmt 0)

5+ Year Member



According to webdesign.about.com

The <fieldset> tag is valid within the following tags:
blockquote, body, center, dd, div, fieldset, form, iframe, li, noframes, noscript, object, td, th


and it seems to work like that in all browsers, including on my Android.

Not sure about the source of that information, though.
7:38 am on Mar 8, 2012 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



{padding: .5em; border: 1px solid black;}
2:30 pm on Mar 8, 2012 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month




Are fieldsets supposed to be ONLY in forms?

According to HTML 4.01 [w3.org], XHTML 1.0 [w3.org], and HTML 5 [w3.org] a fieldset is not restricted to forms only. With that said, *typical* usage is in a form.

The Infolinks algorithm systematically ignores the contents of the <fieldset> tag to avoid placing highlighted links in forms.

It sounds to me like their algorithm is flawed. If they want to avoid placing highlighted links in forms, then they should ignore the contents of the <form> tag, not <fieldset>.
5:11 pm on Mar 8, 2012 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



In terms of semantics, I "kind of" agree with them, regardless of the spec. An <li> should be a "list of items" and shouldn't contain paragraph elements, headings, etc. but according to the spec it's perfectly legal. In the same way, a fieldset implies a set of fields by it's very name - even though your usage is perfectly "legal".

That's just opinion though - the bottom line is that if you want to use their service, you need to follow their specifications. You can do a global search and replace to use some other element, can't you?

Another tact would be to just wrap it in an empty form element with empty actions (seems kind of silly but might be a quick fix.)