On Wed, April 5, 2006 8:33 am, I said:
The HTML <input> element for type 'checkbox' can take 'checked' value.
Here is a comparison:
Checkbox input type that is not checked:
<input name="someWidget" type="checkbox" value="Subscribe">Checkbox input type that is checked:
<input name="someWidget" type="checkbox" value="Subscribe" checked>
"Larry Garfield" wrote:
Untrue. The correct syntax is as follows:
<input name="someWidget" type="checkbox" value="Subscribe" checked="checked" />
Oops. Yes, I relied on BBEdit's insertion, but without a full DOCTYPE, BBE inserted in HTML, not XHTML. :(
Thanks for correcting that, and sorry to confuse.
Of course, in the vast majority of cases you won't be writing a checkbox element yourself but calling the Drupal API for it, which will take care of making it properly formed for you. Drupal is nice like that. :-)
Yep. And this case seems to belong to the non-vast minority, where the OP wants to actually change a form's displayed state.
Good stuff. -- Gary