Welcome to WebmasterWorld Guest from 54.162.157.249

Forum Moderators: incrediBILL

Message Too Old, No Replies

checkbox W3C Validation when checked

     
8:02 pm on Jan 16, 2011 (gmt 0)

5+ Year Member



I don't know what I'm doing wrong here but if I have my checkbox checked and then try to validate the html it fails with this error:

The value of the attribute is defined to be one of a list of possible values but in the document it contained something that is not allowed for that type of attribute. For instance, the “selected” attribute must be either minimized as “selected” or spelled out in full as “selected="selected"”; a value like “selected="true"” is not allowed.

My code is

<input type="checkbox" checked="yes" class="check" name="my-checkbox" value="my-checkbox" />

I'm using the XHTML 1.0 transitional doctype

Not quite sure why I've never run into this before - but then again, perhaps because I've never had the checkboxes checked on entry to the page.

Any help would be greatly appreciated
9:53 pm on Jan 16, 2011 (gmt 0)

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



It should read
checked="checked"
:)
10:16 pm on Jan 16, 2011 (gmt 0)

5+ Year Member



Thanks for that - I knew it'd be something as easy as that!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month