[whatwg] non-checked checkbox posting success?

Alexey Feldgendler alexey at feldgendler.ru
Tue Jul 25 00:54:47 PDT 2006


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



More information about the whatwg mailing list