Solved

onClick does not validate under XHTML Strict

Posted on 2008-06-12
7
1,338 Views
Last Modified: 2012-05-05
I am one error away from having my new template validate under XHTML 4.01 Strict. I am getting: Line 122, Column 136: there is no attribute "onClick".

Where I use it is in the code snippet.

How can I get this functionality to validate under XHTML Strict?
<a onclick="window.print()" href="#">Print</a>

Open in new window

0
Comment
Question by:jen4950
7 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 21773469
do you have onClick or onclick ? and there is no XHTML 4.01 Strict, only HTML 4.01 Strict and there onclick/all attributes are written in lowecase.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 21773471
It may not be possible to get it to validate Strict, but this page may lead you to a workaround:
http://www.eionet.europa.eu/software/design/openingnew

HTH< ~Ray
0
 

Author Comment

by:jen4950
ID: 21773518
I'm sorry- typo- XHTML 1.0 Strict; I actually used the javascript fix to getaround the _blank target problem; degrades gracefully..

But the onclick problem is a little more elusive.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 48

Expert Comment

by:hernst42
ID: 21773674
also in XHTML the onclick attribute must be written in lowercase.
0
 

Author Comment

by:jen4950
ID: 21773806
I've got it in lowercase- here's the file: http://vacorp.com/common/index.asp
0
 
LVL 7

Accepted Solution

by:
alexpercsi earned 500 total points
ID: 21781034
You can eliminate it altogether:

Just write
<a href="javascript:void(window.print());">Print</a>

Open in new window

0
 

Author Closing Comment

by:jen4950
ID: 31466732
Thank you! Well Done!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now