aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes default behavior of a checkbox to be checked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "default behavior of a checkbox to be checked" Watch "default behavior of a checkbox to be checked" New topic
Author

default behavior of a checkbox to be checked

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421


No matter what I do, this page loads unchecked.

Any ideas?

thanks,
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

Something else must be at play here. Perhaps some script that strips the checked attribute?

By the way, using checked="true" is a really bad idea. It leads one to believe that checked="false" will uncheck the box, but it won't. Both checked="true" and checked="false" do the exact same thing: make the checkbox checked. In fact, any value assigned to checked will make the checkbox checked; for example checked="jfdhgfdhgkfdhg".

If you are using HTML4 or HTML5, it should just be checked. If you are using XHTML (archaic), it should be checked="checked". (HTML5 will actually allow either form, but really, why use XML notation for something that's not XML?)


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: default behavior of a checkbox to be checked