homepage Welcome to WebmasterWorld Guest from 54.226.0.225
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
checkbox W3C Validation when checked
greencode




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

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

 

encyclo




msg:4253998
 9:53 pm on Jan 16, 2011 (gmt 0)

It should read
checked="checked" :)
greencode




msg:4254004
 10:16 pm on Jan 16, 2011 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved