By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,379 Members | 1,357 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,379 IT Pros & Developers. It's quick & easy.

XHTML Validation using Javascript in <td> tag

P: n/a
Hello,

This is the only line in my entire code that does not validate in
XHTML :

<td width="24" bgcolor="#330066" onclick="javascript:color1()"
class="borderWidthr"></td>

However, it is valid HTML,since I've defined the function color in the
javascript section of the <head> tag.

This is the error that I get:

Below are the results of attempting to parse this document with an
SGML parser.

Line 176, column 40: there is no attribute "onClick" (explain...).

(And Yes.. onclick is not in Caps in my code).

Do I specifically need a form object for it to validate in XHTML???
Something like
<input name="mybutton" type="button" onclick="color1()" />

Any comments/suggestions would be greatly appreciated!

Thanks
Russ
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
tr******@hotmail.com wrote:
This is the only line in my entire code that does not validate in
XHTML :

<td width="24" bgcolor="#330066" onclick="javascript:color1()"
class="borderWidthr"></td>
Eugh. What a lot of deprecated yuck that should be moved to CSS. It looks
like table abuse too.

http://www.allmyfaqs.com/faq.pl?Tableless_layouts
However, it is valid HTML,since I've defined the function color in the
javascript section of the <head> tag.
There is no relationship between the existance of a JavaScript function, an
the validity of the code HTML.
This is the error that I get:

Below are the results of attempting to parse this document with an
SGML parser.

Line 176, column 40: there is no attribute "onClick" (explain...).

(And Yes.. onclick is not in Caps in my code).
Then either:

(1) Something is wrong with the validator
or
(2) You are misreading your own code

I suspect that 2 is more likely. A URI would make it a lot easier to
troubleshoot.
Do I specifically need a form object for it to validate in XHTML???


No.

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #2

P: n/a
In article <83**************************@posting.google.com >, one of infinite monkeys
at the keyboard of tr******@hotmail.com wrote:
(And Yes.. onclick is not in Caps in my code).


I don't believe you.

A URL would resolve the matter.

--
Nick Kew
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.