[whatwg] non-checked checkbox posting success?

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