W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2006

[whatwg] non-checked checkbox posting success?

From: Alexey Feldgendler <alexey@feldgendler.ru>
Date: Tue, 25 Jul 2006 14:54:47 +0700
Message-ID: <op.tc8ixld31h6og4@feldgendler.plesk.ru>
On Mon, 24 Jul 2006 22:59:07 +0700, Ric Hardacre <whatwg at cycloid.f9.co.uk> wrote:

> When using checkboxes in forms i find myself doing this

I don't see how this

> <input type="checkbox" name="foo" value="true">
> <input type="hidden" name="foo" value="false">
>
> if( checkbox.value == "false" )then
> 	bSomeBool = false;
> else	
> 	bSomeBool = true;

is in any way better than this

<input type="checkbox" name="foo">

if (checkbox.value == "checked") then
	bSomeBool = true;
else	
	bSomeBool = false;

IMHO, the former example adds neither semantic depth nor programming convenience compared to the latter.


-- 
Alexey Feldgendler <alexey at feldgendler.ru>
[ICQ: 115226275] http://feldgendler.livejournal.com
Received on Tuesday, 25 July 2006 00:54:47 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:47 UTC