RE: Single attributes
"Stephen F. Booth" <[email protected]>
| Newsgroups | gmane.comp.gcc.cgicc.general |
|---|---|
| Message-ID | <000501c1f057$35e7a8c0$2ceebe3f@hades> |
Hi Quintin, > A number of HTML attributes only require a name, and not a name = "value" > pair. > Notably the selected, checked and readonly tags when dealing with forms. > The > current behaviour if you set any of these is to get the following output > in your > HTML <input type="text" name="txtBox" value="My Text" readonly="readonly" > />. > > This appears to work, esp for the checked and selected tags of radio > buttons/ > check boxes and select options. But I don't think this is quite what was > intended. This is actually the way things are supposed to work. When I redid the html generation classes a little while ago, I decided to make the output more xhtml-compliant. As part of that, all attribute values are quoted, all html elements print out in lower case, and as you point out, minimized elements are prohibited. Here is an excerpt from http://www.w3.org/TR/xhtml1/#diffs 4.5 Attribute Minimization XML does not support attribute minimization. Attribute-value pairs must be written in full. Attribute names such as compact and checked cannot occur in elements without their value being specified. CORRECT: unminimized attributes <dl compact="compact"> INCORRECT: minimized attributes <dl compact> -Stephen