Re: Help With Checkboxes

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Steve Fulton (cerberus40_at_hotmail.com)
Date: 10/28/04


Date: Thu, 28 Oct 2004 08:35:03 -0400
To: McKirahan <News@mckirahan.com>

McKirahan wrote:

> "Ulf Dornheck Busscher" <ulfdb@web.de> wrote in message
> news:uepfS4GvEHA.2172@TK2MSFTNGP14.phx.gbl...
>> McKirahan wrote:
>> > "George" <anonymous@devdex.com> wrote in message
>> > news:#a76CoFvEHA.2196@TK2MSFTNGP14.phx.gbl...
>> >> response.write("<td width=""23%"" class=""detaillp""><input
>> >> type=""checkbox"" name=""chkWorkType"" value=""03""
>> >> checked=""check"">Exterior</td>")
>> >
>> > [snip]
>> >
>> >> How can I pre-check some of the boxes?
>> >>
>> > Add the word " checked" to the <input> tag(s) of interest.
>>
>> this can't be the problem ... as you see above he allready used the
>> "checked" parameter.
>
> checked=""check""> is not the same as just checked !

If it's not, your browser is broken! According to the spec, it's just
the presence of the attribute that determines whether or not the box
is initially checked; its specified value is immaterial. Even IE gets
it right!

   <fieldset>
   <p>All of these should be checked. If they're not, your browser is
   <em>broken</em>! Stop using it and get one that works.</p>
   <input type="checkbox" checked> Default<br>
   <input type="checkbox" checked="true"> true<br>
   <input type="checkbox" checked="false"> false<br>
   <input type="checkbox" checked="check"> check<br>
   <input type="checkbox" checked="fred"> fred<br>
   </fieldset>

17.4 The INPUT element
http://www.w3.org/TR/html401/interact/forms.html#adef-checked

-- 
Steve
It is far, far safer to be wrong with the majority than to be right
alone. -John Kenneth Galbraith


Relevant Pages