A checkbox or a radiobox value is commonly used to determine if a value
should be stored or not, therefore the value of a check/radio box is
static and has nothing to do with the state of the checkbox.
This is just to clarify what the common understanding is . I like to
know the reason behind
OK, I'll do it like that then. Thanks for the response.
On 9/5/06, John Resig <[EMAIL PROTECTED]> wrote:
> That's not my understanding as to how checkbox values work. If you
> really want to uncheck a checkbox, you have to remove the checked
> attribute - changing the value does /not/ have the sam
That's not my understanding as to how checkbox values work. If you
really want to uncheck a checkbox, you have to remove the checked
attribute - changing the value does /not/ have the same effect.
So, to uncheck it you could do:
$("#foo").removeAttr("checked");
--John
On 9/5/06, Dylan Verheul <[
Dylan Verheul schrieb:
> I have a checkbox like this
>
>
>
> I would expect this code to uncheck it:
> $("#foo").val(0); // any value != 1 should uncheck it
> and this code to check it
> $("#foo").val(1);
>
> It doesn't.
>
> The value attribute of a checkbox is imho not dynamic like a texbox
I have a checkbox like this
I would expect this code to uncheck it:
$("#foo").val(0); // any value != 1 should uncheck it
and this code to check it
$("#foo").val(1);
It doesn't.
The value attribute of a checkbox is imho not dynamic like a texbox's,
but static, and can only be toggled to on or