Industry guru Dave Taylor offers tech support on technical and business topics, including iPhone, iPod, Microsoft Windows, Sony PSP, cellphones, online advertising, CSS, Web design, business, Unix, Linux, SEO, Mac OS X, and shell script programming.     


A cautionary tale about xhtml validators

I've been continuing to tweak the pages at RealLifeDebt.com and have wanted to ensure that the xhtml coding was all proper and correct. So, logically, I turned to the W3C online validator, but kept hitting this one error:
Below are the results of attempting to parse this document with an SGML parser.

Dave's Answer:
Line 195, column 45: there is no attribute "onClick"
    <input type="button" value=" solve " onClick="myPaymentCalc()"
Round and around I went until it dawned on me (thanks to a quick web search) that the problem wasn't that there's no attribute onclick, but that there's no attribute onClick: the 'C' can't be capitalized! I fixed that, and now can happily add:

Valid XHTML 1.0!

to the site. But... sheesh, what a poor error message!

Related HTML, JavaScript and Web Site Programming articles:
✔   How to Create Predefined Google Image Search Links?
Thanks for the Amazon URL [see Creating Amazon Search Links]. That worked beautifully. In fact, I sent you $5.00 for coffee in thanks....
✔   Can I embed a Facebook search box on my blog site?
I've seen your articles about how to add a Twitter or Google search box on a Web page, but I have a tougher...
✔   Can I use CSS for drop shadows on my blog?
I want to give my site a bit of a facelift and add some neat graphical elements. One of which is drop shadows....
✔   How can I embed interactive photo panoramas on my site/blog?
I read through your blog entry about how to take panoramic photos with iOS 6 and an iPhone 5 and got enthused. I've...
✔   How can I create a Twitter search URL shortcut?
I'd like to add a few Twitter search links to my Web site. Is that possible, or does Twitter prohibit this sort of...

Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
    Enter your name: and your email addr:  








Reader Comments To Date: 12

Sven said, on February 11, 2004 3:52 PM:

Whoa -- so that's the solution. After a couple hours with that error message I decided to google for it and promptly found your message up there. Phew. Thanks. :)

Dave Taylor said, on February 11, 2004 6:30 PM:

Glad to help. You might well be interested in a copy of my upcoming book "Creating Cool Web Sites with HTML, XHTML and CSS" (Wiley, coming out in April 2004) wherein I talk at length about why and how to validate pages and style sheets.

Mr. X said, on March 8, 2004 8:42 PM:

Damn... After 20 mn pulling my hair with the validator, I Googled another 20 mn to find your post. Sure enough... I had capitalized the "C"
I hate when I'm that stupid... Thank god you were here to put me back on track. Thanks a ton!

Back to work...

Dave T. said, on March 8, 2004 9:52 PM:

This isn't the first time I've wondered why these validators do such a miserable job of error messages. Seems like instead of just spitting out "INVALID XML STRUCTURE" or something they could actually have some smarts...

Interesting, twenty years ago while working at HP R&D Labs in Palo Alto (across the street from Stanford, actually) I remember reading these excellent research reports out of IBM's Thomas J. Watson Research Center all about what makes a good error message. And here we are, all this time later, and developers still aren't paying attention...

reid said, on May 18, 2005 1:33 PM:

WOW amazing help when i'm coding at 5:30am before my assignment is due in 7 hours. you're a genius. thanks SO MUCH

Heather said, on July 30, 2006 12:44 PM:

Thank you thank you THANK YOU! Stupid capitalized C, wasting an hour of my time...

sidnei dasilva said, on May 3, 2007 2:41 PM:

Thanks so much for this article; I was facing the same problem. W3C actually specifies that in XHTML everything must be lowercase, but I guess I need to find your article to realize this simple thing... thanks!


-Sidnei

OMA said, on June 6, 2007 4:15 AM:

CAUTION!: Dreamweaver 8 automatically capitalizes all onclick, onchange, and such events, in just the very moment you open the file!!! I hate when editors change code without any notice, specially when the changes are wrong, like this.

OMA

John said, on August 22, 2007 6:54 PM:

Well your old article is still helping people, namely me. You just solved my problem in a heart beat.
Thanks for archiving!

Fenix Webmaster said, on August 24, 2007 3:33 PM:

I can't thank you enough and just wish I had searched for the answer hours ago.

Dreamweaver 8 capitalised the onLoad, oClick and onMouseOver on all links in the navigation bar.

Only one more error to fix!

Nitecore said, on September 25, 2008 3:34 PM:

Thank you!

Why does dreamweaver do this?

I think it's time I learnt to code by hand.

john said, on November 12, 2008 8:54 PM:

Oh what good news. Until you open the file in Dreamweaver again...

Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!

I do have a comment, now that you mention it!











I will never send you any unsolicited email. Ever.






Check This Out Too...

 
Look for Answers
Need Help? Ask Dave Taylor!


Follow Me on Pinterest

Find Me on Google+
ADT on G+
© 2002 - 2013 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. My lawyer says "Thanks".
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.