PDA

View Full Version : validation



SJP
11-11-2003, 01:41 AM
For the last couple days I've been trying to get my web page to validate. If I use the 4.01 Transitional DOCTYPE I only get a couple errors that I can live with. Basically I'm using two event handlers (onload and onmouseover) in an Iframe that aren't defined by the spec, but I'm going to leave them in, because they enable me to work around a couple nasty short comings in IE5+ and that accounts for most of my clients. I'd much rather use 4.01 Strict, because with the exception of those items I'm trying to comply but the validator complains about all sorts of other things I'm absolutely clueless how to fix or what I'm doing wrong and their simplistic explanations are no help. For example:

Line 111, column 16: there is no attribute "TARGET" (explain...).
<FORM TARGET="PAGE" ACTION="http://www.sanjuanpersonals.com/cgi-bin/cpy.pl"

Of course there is a TARGET attritbute for the FORM element. If I consult the 4.01 spec it says so! So you might be wondering why I care if the DOCTYPE is Transitional. If I leave it in my page completely breaks. Most of my CSS rules are flat out ignored! And incidently they themselves validate just fine. Here's another one:

Line 120, column 4: character data is not allowed here
NEW ID:<INPUT TYPE="text" NAME="NAME" SIZE=16 MAXLENGTH=24 VALUE=""><BR>

If I consult the 4.01 spec I can find examples where they did the very same thing so again I'm clueless what could be the problem. And enclosing the text in <LABEL></LABEL> elements makes no difference.

Has anyone else experienced similar woes? If I leave the DOCTYPE as simply 4.0 my page looks fine in all the browsers I can test (IE5+, NN6+, Opera and Konqueror). So I'm quickly coming to the conclusion that what the W3C says is irrevelant and I don't really want to take that position but I don't have many other options.

SJP

jalal
11-11-2003, 03:11 AM
SJP

Its not a simple situation, so there is no straight forward answer.
This page gives a good overview of the whole DOCTYPE situation and quirks mode.
http://www.hut.fi/u/hsivonen/doctype.html

BTW, in my 4.01 spec, form doesn't have a target attribute.

HTH

Alejandro
11-11-2003, 01:00 PM
Can you post the adress of the page you're talking about? May be someone may come up with an idea.

FZ
11-11-2003, 05:33 PM
Hmm, doesn't look like target is supported in HTML 4.01 strict. Also, if this is in reference to http://www.sanjuanpersonals.com/myhome.html then you are still using HTML 4.01 strict. Since you are using an iframe, why don't you use HTML 4.01 Frameset? Lastly, try wrapping your input labels in a <p> or <div>...

SJP
11-11-2003, 05:33 PM
I've solved my problem. Well sort of. For one I was omitting the DTD designation and so therefore I was being held to the highest standard (HTML 4.01 Strict) even though I overrode my !DOCTYPE from simply 4.0 to 4.01 Transitional. The frame named as a target in the form is an IFRAME and they're only defined in the loose DTD designation. I still am weirded out why adding the term "Transitional" to my !DOCTYPE makes the browsers go berserk and screw up eveything almost like my CSS rules have no effect. And of course the validator stampers over my use of those two event handlers I referred to above, but going without them is not going to happen until I find a better alternative and/or MS fixes their bugs. And I don't quite understand why I can't mix inline and block elements in some contructs (another 4.01 Strict gripe). So for now I'm living with an illegal !DOCTYPE. Emperically I'm ok. The web-page I'm referring to is: http://www.sanjuanpersonals.com/myhome.html . Thanks all for the feedback.

SJP

SJP
11-11-2003, 05:56 PM
Thanks jalal for the link to that website. Great resource.

SJP

SJP
11-11-2003, 08:09 PM
Ok forget what I said about Transitional going haywire. Putting in the correct DTD designation makes all the difference in the world! The browsers I can test don't go nuts. The validator only complains about my usage of those two events and Netscape 7.1 still says I'm in standards compliance mode which inspite of my sins make me feel less unruly :-) If I removed those two events I could wear the badge of honor (graphic atttesting to HTML 4.01 Transitional compliancy), but at the expense of most of my vistors. Of course no one pours over my web-site like I have looking for flaws in the user interface and coming up with quite ingenious ways if I should say so myself (honk honk :-) ) so if I did dump them few would probably notice or care (I bet).

SJP

SJP
11-11-2003, 09:34 PM
I do get to display the seal of approval on my index page, but not without a work around. Seems that the validator stubs its toe on javascript generated links. It insisted I was missing the operning tag for an A element. So I moved the link strings into a js file and reference their appropriate name instead. That works! This strategy may have other interesting uses like sneaking in proprietary event handlers for objects the W3C doesn't allow but several of the major browsers do. Oh joy! Something more to do :-) (sarcastic grin)

SJP

SJP
11-13-2003, 12:46 AM
So after much *****ing and moaning I found a better alternative to using the onmouseover event of the IFRAME element. And I dumped my special hack for IE (using the onload event) so now I'm back in the circle :-). There's plenty of free browsers that support the standards with out necessitating caving into MS blunders. Add Kameleon 0.8 to the list!

SJP